Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(postgres): Support credential secret #136

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Jul 12, 2024

Description of Changes

Testing

Setup minikube. Make sure you have a license in your environment at $BINDPLANE_LICENSE

minikube start --nodes 1 --cpus 4 --memory 12g 

kubectl create secret generic bindplane \
  --from-literal=license=$BINDPLANE_LICENSE

minikube addons enable metrics-server
minikube addons enable ingress

Deploy Postgres. This will also deploy a secret to the default namespace, which will be used to test this PR.

kubectl apply -f test/helper/postgres/postgres.yaml 
$ kubectl get secret  postgres-credentials -o yaml
apiVersion: v1
data:
  password: cGFzc3dvcmQ=
  username: cG9zdGdyZXM=

Create a values.yaml with the following contents:

config:
  username: bpuser
  password: bppass
  sessions_secret: 4484766F-5016-4077-B8E0-0DE1D637854B
  licenseUseSecret: true

backend:
  type: postgres
  postgres:
    host: postgres.postgres.svc.cluster.local
    database: bindplane
    credentialSecret:
      name: postgres-credentials
      usernameKey: username
      passwordKey: password
    maxConnections: 12
    sslmode: disable

replicas: 1

resources:
  requests:
    memory: 100Mi
    cpu: 100m
  limits:
    memory: 100Mi
    cpu: 100m

jobs:
  resources:
    requests:
      memory: 100Mi
      cpu: 100m
    limits:
      memory: 100Mi
      cpu: 100m

Deploy

helm template charts/bindplane/ --values values.yaml | kubectl apply -f -

The pods will come up without error. It is okay if the main bindplane pod restarted once or twice. It will restart until the jobs pod has come up.

If BindPlane starts without error, Postgres is working. You can check the UI if you want.

kubectl port-forward deploy/release-name-bindplane 3011:3001

Navigate to port 3011 http://localhost:3011/

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CI passes

@jsirianni jsirianni changed the title Joesirianni/bpop 337 helm postgres credential secret feat(postgres): Support credential secret Jul 12, 2024
@jsirianni jsirianni marked this pull request as ready for review July 12, 2024 18:48
@jsirianni jsirianni requested a review from a team as a code owner July 12, 2024 18:48
@jsirianni jsirianni requested review from antonblock and BinaryFissionGames and removed request for a team July 12, 2024 18:48
@jsirianni jsirianni merged commit 63ab2a0 into main Jul 12, 2024
19 checks passed
@jsirianni jsirianni deleted the joesirianni/bpop-337-helm-postgres-credential-secret branch July 12, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants