Skip to content

Commit

Permalink
Merge pull request #27 from simonjcarr/main
Browse files Browse the repository at this point in the history
feat: variable for namespace
  • Loading branch information
lukaszbudnik committed Apr 10, 2023
2 parents d0ca34f + b619c4a commit 1e43a22
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions deploy-local-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
#!/bin/bash

#Set namespace to suit your requirements
namespace=hotel

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx -n ingress-nginx --create-namespace ingress-nginx/ingress-nginx

helm repo add bitnami https://charts.bitnami.com/bitnami

kubectl create ns hotel
kubectl create ns $namespace

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout auth-tls.key -out auth-tls.crt -subj "/CN=auth.localtest.me/O=hotel"
kubectl create secret -n hotel tls auth-tls-secret --key auth-tls.key --cert auth-tls.crt
kubectl create secret -n $namespace tls auth-tls-secret --key auth-tls.key --cert auth-tls.crt

helm install -n hotel keycloak-db bitnami/postgresql-ha --set postgresql.replicaCount=1
helm install -n $namespace keycloak-db bitnami/postgresql-ha --set postgresql.replicaCount=1

sleep 30

kubectl apply -n hotel -f keycloak.yaml
kubectl apply -n $namespace -f keycloak.yaml

sleep 120

kubectl apply -n hotel -f keycloak-ingress.yaml
kubectl apply -n $namespace -f keycloak-ingress.yaml

sleep 30

kubectl get deployment -n hotel
kubectl get service -n hotel
kubectl get ingress -n hotel
kubectl get deployment -n $namespace
kubectl get service -n $namespace
kubectl get ingress -n $namespace

kubectl get pods -n hotel
kubectl get pods -n $namespace

# check if all pods are in ready status
pods=$(kubectl get pods -n hotel --no-headers=true | awk '{print $2}')
pods=$(kubectl get pods -n $namespace --no-headers=true | awk '{print $2}')
all=$(echo "$pods" | wc -l)
ready=$(echo "$pods" | grep '1/1' | wc -l)

Expand Down

0 comments on commit 1e43a22

Please sign in to comment.