From 0fd4ccd224c9d4a28db48642f5bb2da76fce0360 Mon Sep 17 00:00:00 2001 From: Tim Collins <45351296+tico24@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:32:35 +0100 Subject: [PATCH] Test on supported K8s versions (#74) * Support k8s 1.20-1.22 only. * networking.k8s.io/v1 only. * Latest stable sorry-cypress version (1.1.1) --- .github/workflows/lint-test.yml | 6 ++-- charts/sorry-cypress/Chart.yaml | 4 +-- charts/sorry-cypress/README.md | 32 +++++++++++-------- charts/sorry-cypress/changelog.md | 10 ++++++ .../sorry-cypress/templates/ingress-api.yml | 15 +-------- .../templates/ingress-dashboard.yml | 15 +-------- .../templates/ingress-director.yml | 15 +-------- charts/sorry-cypress/templates/ingress-s3.tpl | 15 +-------- charts/sorry-cypress/values.yaml | 8 ++--- 9 files changed, 40 insertions(+), 80 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index fadb308..3f2a009 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -12,11 +12,9 @@ jobs: strategy: matrix: kubernetes_version: - # - "kindest/node:v1.21.1" - There seems to be a bug with the github action which casuses 1.21 to fail to start up. + - "kindest/node:v1.22.2" + - "kindest/node:v1.21.2" - "kindest/node:v1.20.7" - - "kindest/node:v1.19.11" - - "kindest/node:v1.18.19" - - "kindest/node:v1.17.17" fail-fast: true steps: diff --git a/charts/sorry-cypress/Chart.yaml b/charts/sorry-cypress/Chart.yaml index d1b2179..fac96b7 100644 --- a/charts/sorry-cypress/Chart.yaml +++ b/charts/sorry-cypress/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: sorry-cypress description: A Helm chart for Sorry Cypress type: application -version: 1.0.9 -appVersion: 1.1.0 +version: 1.1.0 +appVersion: 1.1.1 home: https://sorry-cypress.dev/ sources: - https://github.com/sorry-cypress/sorry-cypress diff --git a/charts/sorry-cypress/README.md b/charts/sorry-cypress/README.md index fbecf81..85becb6 100644 --- a/charts/sorry-cypress/README.md +++ b/charts/sorry-cypress/README.md @@ -81,6 +81,7 @@ https://sorry-cypress.dev/api#configuration | `api.readinessProbe.timeoutSeconds` | Number of seconds after which the probe times out. | `3` | | `api.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `2` | | `api.readinessProbe.failureThreshold` | When a probe fails, Kubernetes will try `failureThreshold` times before giving up. | `5` | +| `api.ingress.ingressClassName` | The IngressClass that should be used to implement this Ingress | `nginx` | | `api.ingress.labels` | Ingress labels | `{}` | | `api.ingress.annotations` | Ingress annotations | `{}` | | `api.ingress.hosts[0].host` | Hostname to the service installation | `api.chart-example.local` | @@ -109,6 +110,7 @@ https://sorry-cypress.dev/dashboard#configuration | `dashboard.tolerations` | Set tolerations for pods | `[]` | | `dashboard.service.port` | Kubernetes service port | `4000` | | `dashboard.ingress.enabled` | Flag to define if the dashboard service ingress is enabled | `true` | +| `dashboard.ingress.ingressClassName` | The IngressClass that should be used to implement this Ingress | `nginx` | | `dashboard.ingress.labels` | Ingress labels | `{}` | | `dashboard.ingress.annotations` | Ingress annotations | `{}` | | `dashboard.ingress.hosts[0].host` | Hostname to the service installation | `dashboard.chart-example.local` | @@ -138,6 +140,7 @@ https://sorry-cypress.dev/director/configuration | `director.tolerations` | Set tolerations for pods | `[]` | | `director.service.port` | Kubernetes service port | `4000` | | `director.ingress.enabled` | Flag to define if the director service ingress is enabled | `true` | +| `director.ingress.ingressClassName` | The IngressClass that should be used to implement this Ingress | `nginx` | | `director.ingress.labels` | Ingress labels | `{}` | | `director.ingress.annotations` | Ingress annotations | `{}` | | `director.ingress.hosts[0].host` | Hostname to the service installation | `director.chart-example.local` | @@ -167,20 +170,21 @@ https://sorry-cypress.dev/director/storage ## S3 -| Parameter | Description | Default | -| -------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------- | -| `s3.bucketName` | Set the screenshots storage bucket name | `example-bucket` | -| `s3.region` | Set the screenshots storage bucket region | `us-east-1` | -| `s3.acl` | The uploaded video/screenshot object ACL | `"public-read"` | -| `s3.readUrlPrefix` | The host to load the video/screenshot in the dashboard (defaults to the bucket URL) | `""` | -| `s3.accessKey` | The `AWS_ACCESS_KEY_ID` environment variable to configure AWS credentials | `""` | -| `s3.secretAccessKey` | The `AWS_SECRET_ACCESS_KEY` environment variable to configure AWS credentials | `""` | -| `s3.ingress.enabled` | Flag to define if the S3 ingress is enabled. **It will also enable an ExternalName service to expose the bucket** | `true` | -| `s3.ingress.labels` | Ingress labels | `{}` | -| `s3.ingress.annotations` | Ingress annotations | `{}` | -| `s3.ingress.hosts[0].host` | Hostname to the service installation | `static.chart-example.local` | -| `s3.ingress.hosts[0].path` | Root path to the service installation | `/` | -| `s3.ingress.tls` | Ingress secrets for TLS certificates | `[]` | +| Parameter | Description | Default | +| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------- | +| `s3.bucketName` | Set the screenshots storage bucket name | `example-bucket` | +| `s3.region` | Set the screenshots storage bucket region | `us-east-1` | +| `s3.acl` | The uploaded video/screenshot object ACL | `"public-read"` | +| `s3.readUrlPrefix` | The host to load the video/screenshot in the dashboard (defaults to the bucket URL) | `""` | +| `s3.accessKey` | The `AWS_ACCESS_KEY_ID` environment variable to configure AWS credentials | `""` | +| `s3.secretAccessKey` | The `AWS_SECRET_ACCESS_KEY` environment variable to configure AWS credentials | `""` | +| `s3.ingress.enabled` | Flag to define if the S3 ingress is enabled. **It will also enable an ExternalName service to expose the bucket** | `true` | +| `s3.ingress.ingressClassName` | The IngressClass that should be used to implement this Ingress | `nginx` | +| `s3.ingress.labels` | Ingress labels | `{}` | +| `s3.ingress.annotations` | Ingress annotations | `{}` | +| `s3.ingress.hosts[0].host` | Hostname to the service installation | `static.chart-example.local` | +| `s3.ingress.hosts[0].path` | Root path to the service installation | `/` | +| `s3.ingress.tls` | Ingress secrets for TLS certificates | `[]` | ### MinIO diff --git a/charts/sorry-cypress/changelog.md b/charts/sorry-cypress/changelog.md index 025b46d..4183808 100644 --- a/charts/sorry-cypress/changelog.md +++ b/charts/sorry-cypress/changelog.md @@ -1,3 +1,13 @@ +# 1.1.0 +## Update +Only Kubernetes 1.19+ is supported. +This means we only support `networking.k8s.io/v1`. +Latest stable Sorry Cypress version (1.1.1) + +# 1.0.9 +## Fix +Remove hard-coded namespace from service-s3. + # 1.0.0 ## Breaking Changes Uses the bitnami mongodb helm chart. There is no automated upgrade path from previous versions... you will have to manually migrate data. diff --git a/charts/sorry-cypress/templates/ingress-api.yml b/charts/sorry-cypress/templates/ingress-api.yml index a5bb1a4..25cff18 100644 --- a/charts/sorry-cypress/templates/ingress-api.yml +++ b/charts/sorry-cypress/templates/ingress-api.yml @@ -1,14 +1,7 @@ {{- if .Values.api.ingress.hosts -}} -{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} {{- $servicePort := .Values.api.service.port -}} -{{- if $v1Networking }} apiVersion: networking.k8s.io/v1 -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }}-api @@ -22,6 +15,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + ingressClassName: {{ .Values.api.ingress.ingressClassName }} {{- if .Values.api.ingress.tls }} tls: {{- range .Values.api.ingress.tls }} @@ -37,7 +31,6 @@ spec: - host: {{ .host | quote }} http: paths: - {{- if $v1Networking }} - path: {{ .path | default "/" }} pathType: Prefix backend: @@ -45,11 +38,5 @@ spec: name: {{ $fullName }}-api port: number: {{ $servicePort }} - {{- else }} - - path: {{ .path | default "/" }} - backend: - serviceName: {{ $fullName }}-api - servicePort: {{ $servicePort }} - {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/sorry-cypress/templates/ingress-dashboard.yml b/charts/sorry-cypress/templates/ingress-dashboard.yml index 2e4a1a1..5cf27b3 100644 --- a/charts/sorry-cypress/templates/ingress-dashboard.yml +++ b/charts/sorry-cypress/templates/ingress-dashboard.yml @@ -1,14 +1,7 @@ {{- if .Values.dashboard.ingress.enabled -}} -{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} {{- $servicePort := .Values.dashboard.service.port -}} -{{- if $v1Networking }} apiVersion: networking.k8s.io/v1 -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }}-dashboard @@ -22,6 +15,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + ingressClassName: {{ .Values.dashboard.ingress.ingressClassName }} {{- if .Values.dashboard.ingress.tls }} tls: {{- range .Values.dashboard.ingress.tls }} @@ -37,7 +31,6 @@ spec: - host: {{ .host | quote }} http: paths: - {{- if $v1Networking }} - path: {{ .path | default "/" }} pathType: Prefix backend: @@ -45,11 +38,5 @@ spec: name: {{ $fullName }}-dashboard port: number: {{ $servicePort }} - {{- else }} - - path: {{ .path | default "/" }} - backend: - serviceName: {{ $fullName }}-dashboard - servicePort: {{ $servicePort }} - {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/sorry-cypress/templates/ingress-director.yml b/charts/sorry-cypress/templates/ingress-director.yml index 0e6308c..fe65def 100644 --- a/charts/sorry-cypress/templates/ingress-director.yml +++ b/charts/sorry-cypress/templates/ingress-director.yml @@ -1,14 +1,7 @@ {{- if .Values.director.ingress.enabled -}} -{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} {{- $servicePort := .Values.director.service.port -}} -{{- if $v1Networking }} apiVersion: networking.k8s.io/v1 -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }}-director @@ -22,6 +15,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + ingressClassName: {{ .Values.director.ingress.ingressClassName }} {{- if .Values.director.ingress.tls }} tls: {{- range .Values.director.ingress.tls }} @@ -37,7 +31,6 @@ spec: - host: {{ .host | quote }} http: paths: - {{- if $v1Networking }} - path: {{ .path | default "/" }} pathType: Prefix backend: @@ -45,11 +38,5 @@ spec: name: {{ $fullName }}-director port: number: {{ $servicePort }} - {{- else }} - - path: {{ .path | default "/" }} - backend: - serviceName: {{ $fullName }}-director - servicePort: {{ $servicePort }} - {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/sorry-cypress/templates/ingress-s3.tpl b/charts/sorry-cypress/templates/ingress-s3.tpl index 7e42fd1..fc11e0e 100644 --- a/charts/sorry-cypress/templates/ingress-s3.tpl +++ b/charts/sorry-cypress/templates/ingress-s3.tpl @@ -1,13 +1,6 @@ {{- if .Values.s3.ingress.enabled -}} -{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} -{{- if $v1Networking }} apiVersion: networking.k8s.io/v1 -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }}-s3 @@ -21,6 +14,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + ingressClassName: {{ .Values.s3.ingress.ingressClassName }} {{- if .Values.s3.ingress.tls }} tls: {{- range .Values.s3.ingress.tls }} @@ -36,7 +30,6 @@ spec: - host: {{ .host | quote }} http: paths: - {{- if $v1Networking }} - path: {{ .path | default "/" }} pathType: Prefix backend: @@ -44,11 +37,5 @@ spec: name: {{ $fullName }}-s3 port: number: 80 - {{- else }} - - path: {{ .path | default "/" }} - backend: - serviceName: {{ $fullName }}-s3 - servicePort: 80 - {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/sorry-cypress/values.yaml b/charts/sorry-cypress/values.yaml index 77891f6..4932a9b 100644 --- a/charts/sorry-cypress/values.yaml +++ b/charts/sorry-cypress/values.yaml @@ -59,9 +59,9 @@ api: podLabels: {} ingress: + ingressClassName: nginx labels: {} annotations: {} - # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: api.chart-example.local @@ -117,10 +117,10 @@ dashboard: podLabels: {} ingress: + ingressClassName: nginx enabled: true labels: {} annotations: {} - # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: dashboard.chart-example.local @@ -198,9 +198,9 @@ director: ingress: enabled: true + ingressClassName: nginx labels: {} annotations: {} - # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: director.chart-example.local @@ -259,9 +259,9 @@ s3: ingress: # When enabling ingress, an ExternalName service will be also created to expose the bucket. enabled: false + ingressClassName: nginx labels: {} annotations: {} - # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" # nginx.ingress.kubernetes.io/upstream-vhost: .s3-website-.amazonaws.com # nginx.ingress.kubernetes.io/enable-cors: "true"