Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IngressClass logic for newer releases #7341

Merged
merged 6 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 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 @@ -139,11 +143,22 @@ jobs:
with:
version: v0.11.1
image: kindest/node:v1.21.1

- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think docker load < docker.tar.gz is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm migrating from the other CI, I wouldn't want to break this right now (don't know if this is a gh action restriction).

But I'm a +1 of opening a good first issue to investigate and maybe remove this :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


- 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 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 @@ -42,8 +42,7 @@ rules:
- list
- watch
- apiGroups:
- extensions
- "networking.k8s.io" # k8s 1.14+
- networking.k8s.io
resources:
- ingresses
verbs:
Expand All @@ -58,14 +57,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 @@ -80,7 +80,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 @@ -84,7 +84,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
12 changes: 5 additions & 7 deletions charts/ingress-nginx/templates/controller-ingressclass.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) (.Values.controller.ingressClassResource.enabled) -}}
{{- if and (semverCompare "=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
apiVersion: networking.k8s.io/v1beta1
{{- else }}
{{- if .Values.controller.ingressClassResource.enabled -}}
# We don't support namespaced ingressClass yet
# So a ClusterRole and a ClusterRoleBinding is required
apiVersion: networking.k8s.io/v1
{{- end }}
kind: IngressClass
metadata:
labels:
Expand All @@ -12,12 +10,12 @@ metadata:
{{- with .Values.controller.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .Values.controller.ingressClass }}
name: {{ .Values.controller.ingressClassResource.name }}
{{- if .Values.controller.ingressClassResource.default }}
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
{{- end }}
spec:
controller: k8s.io/ingress-nginx
controller: {{ .Values.controller.ingressClassResource.controllerValue }}
{{ template "ingressClass.parameters" . }}
{{- end }}
Loading