Skip to content

Commit

Permalink
🧑‍💻 Add some Init Containers
Browse files Browse the repository at this point in the history
* Add some Init Containers to make sure Postgres is up
  * Governance/Multitenant Agent
  * Mediator
  * Trust Registry
* NATS does not depend on Istio
  • Loading branch information
rblaine95 committed Feb 8, 2025
1 parent 549838e commit a229cc7
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 3 deletions.
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/dev/governance-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ initContainers:
value: "{{ .Values.env.NATS_SERVER }}"
- name: NATS_STREAM
value: "{{ .Values.env.NATS_STREAM }}"
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT

persistence:
enabled: false
Expand Down
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/dev/mediator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ readinessProbe:
# memory: 384Mi

initContainers:
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT
- name: wait-governance-agent
image: curlimages/curl
command:
Expand Down
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/dev/multitenant-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ initContainers:
value: "{{ .Values.env.NATS_SERVER }}"
- name: NATS_STREAM
value: "{{ .Values.env.NATS_STREAM }}"
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT

persistence:
enabled: true
Expand Down
7 changes: 6 additions & 1 deletion helm/acapy-cloud/conf/dev/trust-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ readinessProbe:
autoscaling:
enabled: false

initContainers:
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z cloudapi-pgpool 5432; do echo waiting for pgproxy; sleep 2; done;']

secretData:
POSTGRES_DATABASE_URL: postgresql://trust-registry:trust-registry@cloudapi-postgresql:5432/trust-registry?sslmode=prefer
POSTGRES_DATABASE_URL: postgresql://trust-registry:trust-registry@cloudapi-pgpool:5432/trust-registry?sslmode=prefer

env:
LOG_LEVEL: warning
Expand Down
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/local/governance-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ initContainers:
value: "{{ .Values.env.NATS_SERVER }}"
- name: NATS_STREAM
value: "{{ .Values.env.NATS_STREAM }}"
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT

persistence:
enabled: false
Expand Down
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/local/mediator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ readinessProbe:
# memory: 384Mi

initContainers:
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT
- name: wait-governance-agent
image: curlimages/curl
command:
Expand Down
14 changes: 14 additions & 0 deletions helm/acapy-cloud/conf/local/multitenant-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ initContainers:
value: "{{ .Values.env.NATS_SERVER }}"
- name: NATS_STREAM
value: "{{ .Values.env.NATS_STREAM }}"
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z $(PG_HOST) $(PG_PORT); do echo waiting for postgres; sleep 2; done;']
env:
- name: PG_HOST
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_HOST
- name: PG_PORT
valueFrom:
secretKeyRef:
name: '{{ include "acapy-cloud.fullname" . }}-env'
key: WALLET_DB_PORT

persistence:
enabled: true
Expand Down
7 changes: 6 additions & 1 deletion helm/acapy-cloud/conf/local/trust-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ readinessProbe:
autoscaling:
enabled: false

initContainers:
- name: nc-postgres
image: busybox
command: ['sh', '-c', 'until nc -z cloudapi-pgpool 5432; do echo waiting for pgproxy; sleep 2; done;']

secretData:
POSTGRES_DATABASE_URL: postgresql://trust-registry:trust-registry@cloudapi-postgresql:5432/trust-registry?sslmode=prefer
POSTGRES_DATABASE_URL: postgresql://trust-registry:trust-registry@cloudapi-pgpool:5432/trust-registry?sslmode=prefer

env:
LOG_LEVEL: warning
Expand Down
1 change: 0 additions & 1 deletion tilt/acapy-cloud/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def setup_nats(namespace):
resource_deps=[
"cloudapi-ns",
"build-nats",
"istio",
],
port_forwards=[
port_forward(8222, name="monitoring"),
Expand Down

0 comments on commit a229cc7

Please sign in to comment.