Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
fix: Deprecate Kubernetes versions under v1.19 + support Openshift 3.…
Browse files Browse the repository at this point in the history
…11 (#222)

Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT authored Jan 18, 2022
1 parent f1d3f7d commit 4e16dc1
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
26 changes: 26 additions & 0 deletions istio-configuration/configure-istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ fi

echo "External IP for istio-ingressgateway is ${INGRESS_IP}, creating configmaps..."

K8S_VERSION=$(kubectl version -ojson)
K8S_VERSION_MINOR=$(echo "$K8S_VERSION" | jq -r .serverVersion.minor)

if [[ "$K8S_VERSION_MINOR" < "19" ]]
then
echo "Detected Kubernetes version < 1.19"
# Applying ingress-manifest
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: istio
name: api-keptn-ingress
namespace: keptn
spec:
rules:
- host: $INGRESS_IP.nip.io
http:
paths:
- backend:
serviceName: api-gateway-nginx
servicePort: 80
EOF
else
# Applying ingress-manifest
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
Expand All @@ -39,6 +64,7 @@ spec:
port:
number: 80
EOF
fi

# Applying public gateway
kubectl apply -f - <<EOF
Expand Down
25 changes: 25 additions & 0 deletions quickstart/expose-keptn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,30 @@ SLEEP_TIME=5

print_headline "Configuring Ingress for your local installation"

K8S_VERSION=$(kubectl version -ojson)
K8S_VERSION_MINOR=$(echo "$K8S_VERSION" | jq -r .serverVersion.minor)

if [[ "$K8S_VERSION_MINOR" < "19" ]]
then
echo "Detected Kubernetes version < 1.19"
# Applying ingress-manifest
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: api-keptn-ingress
namespace: keptn
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- backend:
serviceName: api-gateway-nginx
servicePort: 80
EOF
else
# Applying ingress-manifest
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
Expand All @@ -93,6 +117,7 @@ spec:
port:
number: 80
EOF
fi

verify_test_step $? "Applying public gateway failed"

Expand Down
24 changes: 24 additions & 0 deletions quickstart/multistage-delivery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ helm install prometheus prometheus-community/prometheus --namespace monitoring -

verify_test_step $? "Install prometheus failed"

K8S_VERSION=$(kubectl version -ojson)
K8S_VERSION_MINOR=$(echo "$K8S_VERSION" | jq -r .serverVersion.minor)

if [[ "$K8S_VERSION_MINOR" < "19" ]]
then
echo "Detected Kubernetes version < 1.19"
# Applying ingress-manifest
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: prometheus-ingress
namespace: monitoring
spec:
rules:
- host: prometheus.$INGRESS_IP.nip.io
http:
paths:
- backend:
serviceName: prometheus-server
servicePort: 80
EOF
else
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -155,6 +178,7 @@ spec:
port:
number: 80
EOF
fi

verify_test_step $? "Applying Ingress for Prometheus failed"

Expand Down

0 comments on commit 4e16dc1

Please sign in to comment.