Skip to content

Commit

Permalink
Deployment Rancher Istio: Fixed TLS
Browse files Browse the repository at this point in the history
Signed-off-by: Lalith Kota <[email protected]>
  • Loading branch information
lalithkota committed Jul 5, 2024
1 parent e0be99d commit 31743a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion kubernetes/keycloak/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export KEYCLOAK_HOSTNAME=${KEYCLOAK_HOSTNAME:-keycloak.openg2p.net}
export KEYCLOAK_ISTIO_GATEWAY=${KEYCLOAK_ISTIO_GATEWAY:-true}
export KEYCLOAK_ISTIO_VIRTUALSERVICE=${KEYCLOAK_ISTIO_VIRTUALSERVICE:-true}
export KEYCLOAK_GATEWAY_NAME=${KEYCLOAK_GATEWAY_NAME:-keycloak}
export TLS=${TLS:-false}
export NS=${NS:-keycloak-system}

kubectl create ns $NS
Expand All @@ -13,7 +14,11 @@ helm -n $NS upgrade --install keycloak oci://registry-1.docker.io/bitnamicharts/
$@

if [[ "$KEYCLOAK_ISTIO_GATEWAY" == "true" ]]; then
envsubst < istio-gateway.template.yaml | kubectl -n $NS apply -f -
if [[ "$TLS" == "true" ]]; then
envsubst < istio-gateway-tls.template.yaml | kubectl -n $NS apply -f -
else
envsubst < istio-gateway.template.yaml | kubectl -n $NS apply -f -
fi
fi

if [[ "$KEYCLOAK_ISTIO_VIRTUALSERVICE" == "true" ]]; then
Expand Down
7 changes: 6 additions & 1 deletion kubernetes/rancher/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export RANCHER_HOSTNAME=${RANCHER_HOSTNAME:-rancher.openg2p.net}
export RANCHER_ISTIO_GATEWAY=${RANCHER_ISTIO_GATEWAY:-true}
export RANCHER_ISTIO_VIRTUALSERVICE=${RANCHER_ISTIO_VIRTUALSERVICE:-true}
export RANCHER_GATEWAY_NAME=${RANCHER_GATEWAY_NAME:-rancher}
export TLS=${TLS:-false}
export NS=${NS:-cattle-system}

kubectl create ns $NS
Expand All @@ -17,7 +18,11 @@ helm -n $NS upgrade --install rancher rancher-latest/rancher \
$@

if [[ "$RANCHER_ISTIO_GATEWAY" == "true" ]]; then
envsubst < istio-gateway.template.yaml | kubectl -n $NS apply -f -
if [[ "$TLS" == "true" ]]; then
envsubst < istio-gateway-tls.template.yaml | kubectl -n $NS apply -f -
else
envsubst < istio-gateway.template.yaml | kubectl -n $NS apply -f -
fi
fi

if [[ "$RANCHER_ISTIO_VIRTUALSERVICE" == "true" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/rancher/istio-gateway.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
- hosts:
- ${RANCHER_HOSTNAME}
port:
name: http2-redirect-https
number: 8081
name: http2
number: 8080
protocol: HTTP2

0 comments on commit 31743a7

Please sign in to comment.