Skip to content

Commit

Permalink
Fix IngressClass logic for newer releases (kubernetes#7341)
Browse files Browse the repository at this point in the history
* Fix IngressClass logic for newer releases

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Change e2e tests for the new IngressClass presence

* Fix chart and admission tests

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Fix helm chart test

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Fix reviews

* Remove ingressclass code from admission
  • Loading branch information
rikatz committed Aug 21, 2021
1 parent 3122d8c commit 704f7ef
Show file tree
Hide file tree
Showing 68 changed files with 1,406 additions and 607 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
name: Build
runs-on: ubuntu-latest
needs: changes
if: |
(needs.changes.outputs.go == 'true')

steps:

Expand Down Expand Up @@ -116,13 +114,19 @@ jobs:
runs-on: ubuntu-latest
needs:
- changes
- build
if: |
(needs.changes.outputs.charts == 'true')
steps:

- name: Checkout
uses: actions/checkout@v2

- name: cache
uses: actions/download-artifact@v2
with:
name: docker.tar.gz

- name: Lint
run: |
Expand All @@ -137,21 +141,24 @@ jobs:
id: kind
uses: engineerd/setup-kind@v0.5.0
with:
<<<<<<< HEAD
version: v0.11.1
image: kindest/node:v1.20.2
||||||| parent of 78afe7e38 (Drop v1beta1 from ingress nginx (#7156))
version: v0.10.0
image: kindest/node:v1.20.2
=======
version: v0.11.1
image: kindest/node:v1.21.1
>>>>>>> 78afe7e38 (Drop v1beta1 from ingress nginx (#7156))

- uses: geekyeggo/delete-artifact@v1
with:
name: docker.tar.gz
failOnError: false

- name: Load images from cache
run: |
echo "loading docker images..."
pigz -dc docker.tar.gz | docker load
- name: Test
env:
KIND_CLUSTER_NAME: kind
SKIP_CLUSTER_CREATION: true
SKIP_IMAGE_CREATION: true
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-chart-tests
Expand All @@ -167,13 +174,7 @@ jobs:
strategy:
matrix:
<<<<<<< HEAD
k8s: [v1.16.15, v1.17.17, v1.18.19, v1.19.11, v1.20.7, v1.21.2]
||||||| parent of 78afe7e38 (Drop v1beta1 from ingress nginx (#7156))
k8s: [v1.16.15, v1.17.17, v1.18.15, v1.19.7, v1.20.2]
=======
k8s: [v1.19.11, v1.20.7, v1.21.1]
>>>>>>> 78afe7e38 (Drop v1beta1 from ingress nginx (#7156))

steps:

Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-customconfig-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
kind: DaemonSet
admissionWebhooks:
enabled: false
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-customnodeport-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false

Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-headers-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
addHeaders:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-internal-lb-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-nodeport-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-podannotations-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
metrics:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-tcp-udp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/daemonset-tcp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deamonset-default-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deamonset-metrics-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
metrics:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deamonset-psp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deamonset-webhook-and-psp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: true
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deamonset-webhook-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
controller:
kind: DaemonSet
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: true
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-autoscaling-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
autoscaling:
enabled: true
admissionWebhooks:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-customconfig-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
config:
use-proxy-protocol: "true"
admissionWebhooks:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-customnodeport-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-default-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Left blank to test default values
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
service:
type: ClusterIP
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-headers-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
addHeaders:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-internal-lb-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-metrics-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
metrics:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-nodeport-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-podannotations-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
metrics:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-psp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
service:
type: ClusterIP

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-tcp-udp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: false
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-tcp-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
service:
type: ClusterIP

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: true
service:
Expand Down
4 changes: 4 additions & 0 deletions charts/ingress-nginx/ci/deployment-webhook-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
controller:
image:
repository: ingress-controller/controller
tag: 1.0.0-dev
digest: null
admissionWebhooks:
enabled: true
service:
Expand Down
8 changes: 3 additions & 5 deletions charts/ingress-nginx/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ rules:
- list
- watch
- apiGroups:
- extensions
- "networking.k8s.io" # k8s 1.14+
- networking.k8s.io
resources:
- ingresses
verbs:
Expand All @@ -64,14 +63,13 @@ rules:
- create
- patch
- apiGroups:
- extensions
- "networking.k8s.io" # k8s 1.14+
- networking.k8s.io
resources:
- ingresses/status
verbs:
- update
- apiGroups:
- "networking.k8s.io" # k8s 1.14+
- networking.k8s.io
resources:
- ingressclasses
verbs:
Expand Down
2 changes: 1 addition & 1 deletion charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
- --publish-service={{ template "ingress-nginx.controller.publishServicePath" . }}
{{- end }}
- --election-id={{ .Values.controller.electionID }}
- --ingress-class={{ .Values.controller.ingressClass }}
- --controller-class={{ .Values.controller.ingressClassResource.controllerValue }}
- --configmap={{ default "$(POD_NAMESPACE)" .Values.controller.configMapNamespace }}/{{ include "ingress-nginx.controller.fullname" . }}
{{- if .Values.tcp }}
- --tcp-services-configmap={{ default "$(POD_NAMESPACE)" .Values.controller.tcp.configMapNamespace }}/{{ include "ingress-nginx.fullname" . }}-tcp
Expand Down
2 changes: 1 addition & 1 deletion charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
- --publish-service={{ template "ingress-nginx.controller.publishServicePath" . }}
{{- end }}
- --election-id={{ .Values.controller.electionID }}
- --ingress-class={{ .Values.controller.ingressClass }}
- --controller-class={{ .Values.controller.ingressClassResource.controllerValue }}
- --configmap={{ default "$(POD_NAMESPACE)" .Values.controller.configMapNamespace }}/{{ include "ingress-nginx.controller.fullname" . }}
{{- if .Values.tcp }}
- --tcp-services-configmap={{ default "$(POD_NAMESPACE)" .Values.controller.tcp.configMapNamespace }}/{{ include "ingress-nginx.fullname" . }}-tcp
Expand Down
Loading

0 comments on commit 704f7ef

Please sign in to comment.