Unverified Commit 086f72a7 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #61859 from hyperbolic2346/mwilson/nginx-daemonset-pre-1.9

Automatic merge from submit-queue (batch tested with PRs 57658, 61304, 61560, 61859, 61870). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fixing ingress controller daemonset on k8s < 1.9 **What this PR does / why we need it**: When we switched to an ingress daemonset, we didn't account for older installs. The api version changed on version 1.9, so anything pre-1.9 needs a different version. This PR makes the api version a template so we can change it depending on the version of k8s installed. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/526 **Special notes for your reviewer**: **Release note**: ```release-note Fixed ingress issue with CDK and pre-1.9 versions of kubernetes. ```
parents bc2cc5a7 884d8de8
...@@ -746,6 +746,10 @@ def launch_default_ingress_controller(): ...@@ -746,6 +746,10 @@ def launch_default_ingress_controller():
else: else:
context['ingress_image'] = \ context['ingress_image'] = \
"k8s.gcr.io/nginx-ingress-controller:0.9.0-beta.15" # noqa "k8s.gcr.io/nginx-ingress-controller:0.9.0-beta.15" # noqa
if get_version('kubelet') < (1, 9):
context['daemonset_api_version'] = 'extensions/v1beta1'
else:
context['daemonset_api_version'] = 'apps/v1beta2'
context['juju_application'] = hookenv.service_name() context['juju_application'] = hookenv.service_name()
manifest = addon_path.format('ingress-daemon-set.yaml') manifest = addon_path.format('ingress-daemon-set.yaml')
render('ingress-daemon-set.yaml', manifest, context) render('ingress-daemon-set.yaml', manifest, context)
......
...@@ -127,7 +127,7 @@ kind: ConfigMap ...@@ -127,7 +127,7 @@ kind: ConfigMap
metadata: metadata:
name: nginx-load-balancer-{{ juju_application }}-conf name: nginx-load-balancer-{{ juju_application }}-conf
--- ---
apiVersion: apps/v1beta2 apiVersion: {{ daemonset_api_version }}
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: nginx-ingress-{{ juju_application }}-controller name: nginx-ingress-{{ juju_application }}-controller
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment