Skip to content

Commit fec971d

Browse files
committed
k8s apply part of tf now
Signed-off-by: bhumi46 <thisisbn46@gmail.com>
1 parent 469e2f6 commit fec971d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • terraform/modules/aws/postgresql-setup

terraform/modules/aws/postgresql-setup/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,20 @@ EOF
152152
# Verify kubectl connectivity
153153
"kubectl cluster-info",
154154

155+
# Create postgres namespace if it doesn't exist
156+
"echo 'Creating postgres namespace...'",
157+
"kubectl create namespace postgres --dry-run=client -o yaml | kubectl apply -f -",
158+
155159
# Deploy PostgreSQL resources
156160
"kubectl apply -f /tmp/postgres-postgresql.yml",
157161
"kubectl apply -f /tmp/postgres-setup-config.yml",
158162
"echo 'PostgreSQL Kubernetes resources deployed successfully!'",
159163

164+
# Verify the resources were created
165+
"echo 'Verifying PostgreSQL resources...'",
166+
"kubectl get secret -n postgres postgres-postgresql || echo 'Secret not found'",
167+
"kubectl get configmap -n postgres postgres-setup-config || echo 'ConfigMap not found'",
168+
160169
# Cleanup
161170
"rm -f /tmp/postgres-postgresql.yml /tmp/postgres-setup-config.yml"
162171
]

0 commit comments

Comments
 (0)