diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..20890f4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,16 @@ +--- +name: Bug Report +about: A bug 🐞 +--- + +## Summary + +Sorry cypress does X, but should do Y + +## How to reproduce + +## Environment + +- sorry-cypress version: `` +- cypress version: `` +- helm chart version: `` diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..040bf3b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,14 @@ +--- +name: Feature Request +about: Create a feature request for Sorry Cypress Helm +--- + +- [ ] I have searched issues for similar feature requests + +## What is this feature about (1 sentence) + +## Why is it needed? What is the value? For whom do we build it? + +## High-level feature overview + +## Other diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index bb6dffe..170aeff 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -1,6 +1,6 @@ name: Lint and Test Charts -on: +on: pull_request: branches: - main @@ -42,9 +42,7 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.1.0 - with: - node_image: kindest/node:v1.18.8 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) - run: ct install --debug --config test.yaml \ No newline at end of file + run: ct install --debug --config test.yaml diff --git a/README.md b/README.md index b1da8aa..63497a1 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ https://sorry-cypress.dev/api#configuration | `api.image.tag` | Image tag | `latest` | | `api.image.pullPolicy` | Image pull policy | `Always` | | `api.resources` | Resources to initialize the container | `{}` | +| `api.podAnnotations` | Set annotations for pods | `{}` | +| `api.podLabels` | Set additional labels for pods | `{}` | | `api.service.port` | Kubernetes service port | `4000` | | `api.ingress.labels` | Ingress labels | `{}` | | `api.ingress.annotations` | Ingress annotations | `{}` | @@ -81,6 +83,8 @@ https://sorry-cypress.dev/dashboard#configuration | `dashboard.resources` | Resources to initialize the container | `{}` | | `dashboard.environmentVariables.ciUrl` | Set optional environment variable `CI_URL` to add a link to your CI tool | `""` | | `dashboard.environmentVariables.graphQlSchemaUrl` | Set the environment variable `GRAPHQL_SCHEMA_URL` with the URL of API service. | `""` | +| `dashboard.podAnnotations` | Set annotations for pods | `{}` | +| `dashboard.podLabels` | Set additional labels 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.labels` | Ingress labels | `{}` | @@ -106,6 +110,8 @@ https://sorry-cypress.dev/director/configuration | `director.s3.region` | Set the screenshots storage bucket region, if the screenshots driver is set to `"../screenshots/s3.driver"` | `us-east-1` | | `director.s3.accessKey` | The `AWS_ACCESS_KEY_ID` environment variable to configure AWS credentials, if the screenshots driver is set to `"../screenshots/s3.driver"` | `abc` | | `director.s3.secretAccessKey` | The `AWS_SECRET_ACCESS_KEY` environment variable to configure AWS credentials, if the screenshots driver is set to `"../screenshots/s3.driver"` | `zyx` | +| `director.podAnnotations` | Set annotations for pods | `{}` | +| `director.podLabels` | Set additional labels 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.labels` | Ingress labels | `{}` | @@ -129,4 +135,6 @@ If the execution driver is set to `"../execution/mongo/driver"`, you may enable | `mongo.persistence.accessMode` | Volumes access mode to be set | `ReadWriteOnce` | | `mongo.persistence.size` | Size of the volume | `1Gi` | | `mongo.resources` | Resources to initialize the container | `{}` | +| `mongo.podAnnotations` | Set annotations for pods | `{}` | +| `mongo.podLabels` | Set additional labels for pods | `{}` | | `mongo.service.port` | Kubernetes service port | `4000` | diff --git a/charts/sorry-cypress/Chart.yaml b/charts/sorry-cypress/Chart.yaml index f11c06c..dcdf073 100644 --- a/charts/sorry-cypress/Chart.yaml +++ b/charts/sorry-cypress/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sorry-cypress description: A Helm chart for Sorry Cypress type: application -version: 0.1.11 +version: 0.1.12 appVersion: 0.6.1 home: https://sorry-cypress.dev/ sources: diff --git a/charts/sorry-cypress/templates/deployment-api.yml b/charts/sorry-cypress/templates/deployment-api.yml index 03726dd..e9891b7 100644 --- a/charts/sorry-cypress/templates/deployment-api.yml +++ b/charts/sorry-cypress/templates/deployment-api.yml @@ -11,9 +11,16 @@ spec: app: {{ include "sorry-cypress-helm.fullname" . }}-api template: metadata: + name: {{ include "sorry-cypress-helm.fullname" . }}-api labels: app: {{ include "sorry-cypress-helm.fullname" . }}-api - name: {{ include "sorry-cypress-helm.fullname" . }}-api + {{- with .Values.api.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end}} + {{- with .Values.api.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - env: diff --git a/charts/sorry-cypress/templates/deployment-dashboard.yml b/charts/sorry-cypress/templates/deployment-dashboard.yml index 7625da3..5732f0b 100644 --- a/charts/sorry-cypress/templates/deployment-dashboard.yml +++ b/charts/sorry-cypress/templates/deployment-dashboard.yml @@ -11,9 +11,16 @@ spec: app: {{ include "sorry-cypress-helm.fullname" . }}-dashboard template: metadata: + name: {{ include "sorry-cypress-helm.fullname" . }}-dashboard labels: app: {{ include "sorry-cypress-helm.fullname" . }}-dashboard - name: {{ include "sorry-cypress-helm.fullname" . }}-dashboard + {{- with .Values.dashboard.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end}} + {{- with .Values.dashboard.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - env: diff --git a/charts/sorry-cypress/templates/deployment-director.yml b/charts/sorry-cypress/templates/deployment-director.yml index 29b0837..ba51ab5 100644 --- a/charts/sorry-cypress/templates/deployment-director.yml +++ b/charts/sorry-cypress/templates/deployment-director.yml @@ -9,9 +9,16 @@ spec: app: {{ include "sorry-cypress-helm.fullname" . }}-director template: metadata: + name: {{ include "sorry-cypress-helm.fullname" . }}-director labels: app: {{ include "sorry-cypress-helm.fullname" . }}-director - name: {{ include "sorry-cypress-helm.fullname" . }}-director + {{- with .Values.director.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end}} + {{- with .Values.director.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - env: diff --git a/charts/sorry-cypress/templates/deployment-mongo.yml b/charts/sorry-cypress/templates/deployment-mongo.yml index 4350a03..6b506a0 100644 --- a/charts/sorry-cypress/templates/deployment-mongo.yml +++ b/charts/sorry-cypress/templates/deployment-mongo.yml @@ -10,9 +10,16 @@ spec: app: {{ include "sorry-cypress-helm.fullname" . }}-mongo template: metadata: + name: {{ include "sorry-cypress-helm.fullname" . }}-mongo labels: app: {{ include "sorry-cypress-helm.fullname" . }}-mongo - name: {{ include "sorry-cypress-helm.fullname" . }}-mongo + {{- with .Values.mongo.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end}} + {{- with .Values.mongo.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - image: "{{ .Values.mongo.image.repository }}:{{ .Values.mongo.image.tag | default .Chart.AppVersion }}" diff --git a/charts/sorry-cypress/templates/ingress-api.yml b/charts/sorry-cypress/templates/ingress-api.yml index f6d5403..41be5f0 100644 --- a/charts/sorry-cypress/templates/ingress-api.yml +++ b/charts/sorry-cypress/templates/ingress-api.yml @@ -1,7 +1,10 @@ {{- if .Values.api.ingress.hosts -}} +{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} -{{- $svcPort := .Values.api.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- $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 @@ -34,8 +37,18 @@ spec: - host: {{ .host | quote }} http: paths: + {{- if $v1Networking }} + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName }}-api + port: + number: {{ $servicePort }} + {{- else }} - backend: serviceName: {{ $fullName }}-api - servicePort: {{ $svcPort }} + 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 4a8bed7..1c74bb1 100644 --- a/charts/sorry-cypress/templates/ingress-dashboard.yml +++ b/charts/sorry-cypress/templates/ingress-dashboard.yml @@ -1,7 +1,10 @@ {{- if .Values.dashboard.ingress.enabled -}} +{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} -{{- $svcPort := .Values.dashboard.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- $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 @@ -34,8 +37,18 @@ spec: - host: {{ .host | quote }} http: paths: + {{- if $v1Networking }} + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName }}-api + port: + number: {{ $servicePort }} + {{- else }} - backend: - serviceName: {{ $fullName }}-dashboard - servicePort: {{ $svcPort }} + serviceName: {{ $fullName }}-api + 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 07c24d9..c6a27e4 100644 --- a/charts/sorry-cypress/templates/ingress-director.yml +++ b/charts/sorry-cypress/templates/ingress-director.yml @@ -1,7 +1,10 @@ {{- if .Values.director.ingress.enabled -}} +{{- $v1Networking := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} {{- $fullName := include "sorry-cypress-helm.fullname" . -}} -{{- $svcPort := .Values.director.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- $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 @@ -34,8 +37,18 @@ spec: - host: {{ .host | quote }} http: paths: + {{- if $v1Networking }} + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName }}-api + port: + number: {{ $servicePort }} + {{- else }} - backend: - serviceName: {{ $fullName }}-director - servicePort: {{ $svcPort }} + serviceName: {{ $fullName }}-api + servicePort: {{ $servicePort }} + {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/sorry-cypress/values.yaml b/charts/sorry-cypress/values.yaml index d8814bc..2a2e89e 100644 --- a/charts/sorry-cypress/values.yaml +++ b/charts/sorry-cypress/values.yaml @@ -24,6 +24,12 @@ api: service: port: 4000 + # Set annotations for pods + podAnnotations: {} + + # Additional pod labels + podLabels: {} + ingress: labels: {} annotations: {} @@ -63,6 +69,12 @@ dashboard: service: port: 8080 + # Set annotations for pods + podAnnotations: {} + + # Additional pod labels + podLabels: {} + ingress: enabled: true labels: {} @@ -122,6 +134,12 @@ director: accessKeyId: abc secretAccessKey: zyx + # Set annotations for pods + podAnnotations: {} + + # Additional pod labels + podLabels: {} + service: port: 1234 @@ -170,5 +188,11 @@ mongo: # cpu: 100m # memory: 128Mi + # Set annotations for pods + podAnnotations: {} + + # Additional pod labels + podLabels: {} + service: port: 27017