From 1ad1467a91fee048b799dec767351b05b7fc5716 Mon Sep 17 00:00:00 2001 From: Denis Neuling Date: Tue, 26 Apr 2022 12:58:35 +0200 Subject: [PATCH] Extend helm notes Signed-off-by: Denis Neuling --- .github/workflows/helm-lint.yaml | 57 ++++++++++++++ chart_schema.yaml | 38 ++++++++++ ct.yaml | 4 + deployment/helm/README.md | 5 ++ deployment/helm/edc-controlplane/Chart.yaml | 2 + .../helm/edc-controlplane/templates/NOTES.txt | 74 +++++++++++++++---- .../templates/deployment.yaml | 6 +- .../edc-controlplane/templates/ingress.yaml | 20 +++-- deployment/helm/edc-controlplane/values.yaml | 6 +- deployment/helm/edc-dataplane/Chart.yaml | 2 + .../helm/edc-dataplane/templates/NOTES.txt | 64 ++++++++++++---- .../edc-dataplane/templates/deployment.yaml | 6 +- .../helm/edc-dataplane/templates/ingress.yaml | 20 +++-- deployment/helm/edc-dataplane/values.yaml | 15 ++-- lintconf.yaml | 42 +++++++++++ 15 files changed, 293 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/helm-lint.yaml create mode 100644 chart_schema.yaml create mode 100644 ct.yaml create mode 100644 deployment/helm/README.md create mode 100644 lintconf.yaml diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml new file mode 100644 index 000000000..8d1dcbb3c --- /dev/null +++ b/.github/workflows/helm-lint.yaml @@ -0,0 +1,57 @@ +--- +name: "Lint helm charts" + +on: + push: + branches: + - main + - develop + tags: + - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + branches: + - '*' + +jobs: + helm-lint: + runs-on: ubuntu-latest + steps: + ############## + ### Set-Up ### + ############## + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: helm (setup) + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + - + name: python (setup) + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - + name: chart-testing (setup) + uses: helm/chart-testing-action@v2.2.1 + ##################### + ### Chart Testing ### + ##################### + - + name: chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config ct.yaml --target-branch develop) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + - + name: chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: | + ct lint \ + --config ct.yaml \ + --all diff --git a/chart_schema.yaml b/chart_schema.yaml new file mode 100644 index 000000000..6581ef7e8 --- /dev/null +++ b/chart_schema.yaml @@ -0,0 +1,38 @@ +--- +name: str() +home: str(required=False) +version: str() +apiVersion: str() +appVersion: any(str(), num(), required=False) +description: str(required=False) +keywords: list(str(), required=False) +sources: list(str(), required=False) +maintainers: list(include('maintainer'), required=False) +dependencies: list(include('dependency'), required=False) +icon: str(required=False) +engine: str(required=False) +condition: str(required=False) +tags: str(required=False) +deprecated: bool(required=False) +kubeVersion: str(required=False) +annotations: map(str(), str(), required=False) +type: str(required=False) +--- +maintainer: + name: str(required=False) + email: str(required=False) + url: str(required=False) +--- +dependency: + name: str() + version: str() + repository: str(required=False) + condition: str(required=False) + tags: list(str(), required=False) + enabled: bool(required=False) + import-values: any(list(str()), list(include('import-value')), required=False) + alias: str(required=False) +--- +import-value: + child: str() + parent: str() diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 000000000..4c716ff7d --- /dev/null +++ b/ct.yaml @@ -0,0 +1,4 @@ +--- +validate-maintainers: false +chart-dirs: + - deployment/helm diff --git a/deployment/helm/README.md b/deployment/helm/README.md new file mode 100644 index 000000000..c5f541187 --- /dev/null +++ b/deployment/helm/README.md @@ -0,0 +1,5 @@ +# Chart Linting + +Chart linting is performed using [helm's CT tool](https://github.com/helm/chart-testing). + +Configuration files for [CT](../../ct.yaml), [Yamale](../../chart_schema.yaml) and [Yamllint](../../lintconf.yaml) have been provided. diff --git a/deployment/helm/edc-controlplane/Chart.yaml b/deployment/helm/edc-controlplane/Chart.yaml index e10cf6dc0..0661b813a 100644 --- a/deployment/helm/edc-controlplane/Chart.yaml +++ b/deployment/helm/edc-controlplane/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 name: edc-controlplane description: EDC Control-Plane @@ -5,3 +6,4 @@ home: https://github.com/catenax-ng/product-edc/deployment/helm/edc-controlplane type: application appVersion: "0.0.1" version: 0.0.1 +maintainers: [] diff --git a/deployment/helm/edc-controlplane/templates/NOTES.txt b/deployment/helm/edc-controlplane/templates/NOTES.txt index b7cbf4507..fd365cb24 100644 --- a/deployment/helm/edc-controlplane/templates/NOTES.txt +++ b/deployment/helm/edc-controlplane/templates/NOTES.txt @@ -1,22 +1,66 @@ -1. Get the application URL by running these commands: + +CHART NAME: {{ .Chart.Name }} +CHART VERSION: {{ .Chart.Version }} +APP VERSION: {{ .Chart.AppVersion }} + +Logs can be accessed by running this command: + + kubectl logs --tail 100 -f \ + --namespace {{ .Release.Namespace }} + -l "app.kubernetes.io/name={{ include "edc-controlplane.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" + {{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + +Following ingress URLS are available: + {{- range $name, $mapping := .Values.edc.endpoints }} + {{- if $mapping.ingress }} + Visit http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostname }}{{ $mapping.path }} to access the {{ $name }} api {{- end }} -{{- end }} + {{- end }} + {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edc-controlplane.fullname" . }}) +Get the application URLs by running these commands: export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "edc-controlplane.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "edc-controlplane.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} + + export NODE_PORT_DEFAULT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + export NODE_PORT_DATA=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[1].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + export NODE_PORT_VALIDATION=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[2].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + export NODE_PORT_CONTROL=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[3].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + export NODE_PORT_IDS=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[4].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + export NODE_PORT_METRICS=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[5].nodePort}" services {{ include "edc-controlplane.fullname" . }}}") + + echo "Visit http://$NODE_IP:$NODE_PORT_DEFAULT to access the default api" + echo "Visit http://$NODE_IP:$NODE_PORT_DATA to access the data management api" + echo "Visit http://$NODE_IP:$NODE_PORT_VALIDATION to access the data transfer validation api" + echo "Visit http://$NODE_IP:$NODE_PORT_CONTROL to access the control api" + echo "Visit http://$NODE_IP:$NODE_PORT_IDS to access the IDS api" + echo "Visit http://$NODE_IP:$NODE_PORT_METRICS to access the metrics api" + {{- else if contains "ClusterIP" .Values.service.type }} +Get the application URL by running these commands: + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "edc-controlplane.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT + + export CONTAINER_PORT_DEFAULT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + export CONTAINER_PORT_DATA=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[1].containerPort}") + export CONTAINER_PORT_VALIDATION=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[2].containerPort}") + export CONTAINER_PORT_CONTROL=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[3].containerPort}") + export CONTAINER_PORT_IDS=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[4].containerPort}") + export CONTAINER_PORT_METRICS=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[5].containerPort}") + + echo "Visit http://127.0.0.1:8080 to access the default api" + echo "Visit http://127.0.0.1:8182 to access the data management api" + echo "Visit http://127.0.0.1:8182 to access the data transfer validation api" + echo "Visit http://127.0.0.1:9999 to access the control api" + echo "Visit http://127.0.0.1:8282 to access the IDS api" + echo "Visit http://127.0.0.1:9090 to access the metrics api" + + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME \ + 8080:$CONTAINER_PORT_DEFAULT \ + 8182:$CONTAINER_PORT_DATA \ + 8182:$CONTAINER_PORT_VALIDATION \ + 9999:$CONTAINER_PORT_CONTROL \ + 8282:$CONTAINER_PORT_IDS \ + 9090:$CONTAINER_PORT_METRICS + {{- end }} diff --git a/deployment/helm/edc-controlplane/templates/deployment.yaml b/deployment/helm/edc-controlplane/templates/deployment.yaml index 0d403d251..99824c75e 100644 --- a/deployment/helm/edc-controlplane/templates/deployment.yaml +++ b/deployment/helm/edc-controlplane/templates/deployment.yaml @@ -43,15 +43,15 @@ spec: - name: default containerPort: {{ .Values.edc.endpoints.default.port }} protocol: TCP - - name: control - containerPort: {{ .Values.edc.endpoints.control.port }} - protocol: TCP - name: data containerPort: {{ .Values.edc.endpoints.data.port }} protocol: TCP - name: validation containerPort: {{ .Values.edc.endpoints.validation.port }} protocol: TCP + - name: control + containerPort: {{ .Values.edc.endpoints.control.port }} + protocol: TCP - name: ids containerPort: {{ .Values.edc.endpoints.ids.port }} protocol: TCP diff --git a/deployment/helm/edc-controlplane/templates/ingress.yaml b/deployment/helm/edc-controlplane/templates/ingress.yaml index c9014fbbd..b62ee2481 100644 --- a/deployment/helm/edc-controlplane/templates/ingress.yaml +++ b/deployment/helm/edc-controlplane/templates/ingress.yaml @@ -1,4 +1,4 @@ -{{- if .Values.ingress.enabled -}} +{{- if .Values.ingress.enabled }} --- {{- $fullName := include "edc-controlplane.fullname" . -}} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} @@ -6,11 +6,11 @@ {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} {{- end }} {{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }} apiVersion: networking.k8s.io/v1beta1 -{{- else -}} +{{- else }} apiVersion: extensions/v1beta1 {{- end }} kind: Ingress @@ -22,11 +22,11 @@ metadata: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.ingress.certManager -}} - {{- if .Values.ingress.certManager.issuer -}} + {{- if .Values.ingress.certManager }} + {{- if .Values.ingress.certManager.issuer }} cert-manager.io/issuer: {{ .Values.ingress.certManager.issuer }} {{- end }} - {{- if .Values.ingress.certManager.clusterIssuer -}} + {{- if .Values.ingress.certManager.clusterIssuer }} cert-manager.io/cluster-issuer: {{ .Values.ingress.certManager.clusterIssuer }} {{- end }} {{- end }} @@ -45,12 +45,10 @@ spec: - host: {{ .Values.ingress.hostname }} http: paths: - {{ range $name, $mapping := .Values.edc.endpoints }} - {{ if $mapping.ingress -}} + {{- range $name, $mapping := .Values.edc.endpoints }} + {{- if $mapping.ingress }} - path: {{ $mapping.path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} pathType: Prefix - {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: diff --git a/deployment/helm/edc-controlplane/values.yaml b/deployment/helm/edc-controlplane/values.yaml index 03a7d17a7..3ba6adc41 100644 --- a/deployment/helm/edc-controlplane/values.yaml +++ b/deployment/helm/edc-controlplane/values.yaml @@ -1,3 +1,4 @@ +--- # Default values for edc-controlplane. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -129,13 +130,13 @@ ingress: ## ## Set to true to enable ingress record generation ## - enabled: true + enabled: false ## ## Defines the ingress class to use https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class ## className: "" ## - ## En + ## Enables TLS on the ingress resource ## tls: false @@ -335,4 +336,3 @@ configuration: # edc.web.rest.cors.headers= # edc.web.rest.cors.methods= # edc.web.rest.cors.origins= - diff --git a/deployment/helm/edc-dataplane/Chart.yaml b/deployment/helm/edc-dataplane/Chart.yaml index feaed85d3..82559407b 100644 --- a/deployment/helm/edc-dataplane/Chart.yaml +++ b/deployment/helm/edc-dataplane/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 name: edc-dataplane description: EDC Data-Plane @@ -5,3 +6,4 @@ home: https://github.com/catenax-ng/product-edc/deployment/helm/edc-dataplane type: application appVersion: "0.0.1" version: 0.0.1 +maintainers: [] diff --git a/deployment/helm/edc-dataplane/templates/NOTES.txt b/deployment/helm/edc-dataplane/templates/NOTES.txt index f0cb7547c..5197611e0 100644 --- a/deployment/helm/edc-dataplane/templates/NOTES.txt +++ b/deployment/helm/edc-dataplane/templates/NOTES.txt @@ -1,22 +1,56 @@ -1. Get the application URL by running these commands: + +CHART NAME: {{ .Chart.Name }} +CHART VERSION: {{ .Chart.Version }} +APP VERSION: {{ .Chart.AppVersion }} + +Logs can be accessed by running this command: + + kubectl logs --tail 100 -f \ + --namespace {{ .Release.Namespace }} + -l "app.kubernetes.io/name={{ include "edc-dataplane.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" + {{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + +Following ingress URLS are available: + {{- range $name, $mapping := .Values.edc.endpoints }} + {{- if $mapping.ingress }} + Visit http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostname }}{{ $mapping.path }} to access the {{ $name }} api {{- end }} -{{- end }} + {{- end }} + {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edc-dataplane.fullname" . }}) +Get the application URLs by running these commands: export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "edc-dataplane.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "edc-dataplane.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} + + export NODE_PORT_DEFAULT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "edc-dataplane.fullname" . }}}") + export NODE_PORT_PUBLIC=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[1].nodePort}" services {{ include "edc-dataplane.fullname" . }}}") + export NODE_PORT_CONTROL=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[2].nodePort}" services {{ include "edc-dataplane.fullname" . }}}") + export NODE_PORT_METRICS=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[3].nodePort}" services {{ include "edc-dataplane.fullname" . }}}") + + echo "Visit http://$NODE_IP:$NODE_PORT_DEFAULT to access the default api" + echo "Visit http://$NODE_IP:$NODE_PORT_PUBLIC to access the public data transfer api" + echo "Visit http://$NODE_IP:$NODE_PORT_CONTROL to access the control api" + echo "Visit http://$NODE_IP:$NODE_PORT_METRICS to access the metrics api" + {{- else if contains "ClusterIP" .Values.service.type }} +Get the application URL by running these commands: + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "edc-dataplane.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT + + export CONTAINER_PORT_DEFAULT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + export CONTAINER_PORT_PUBLIC=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[1].containerPort}") + export CONTAINER_PORT_CONTROL=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[2].containerPort}") + export CONTAINER_PORT_METRICS=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[3].containerPort}") + + echo "Visit http://127.0.0.1:8080 to access the default api" + echo "Visit http://127.0.0.1:8185 to access the public data transfer api" + echo "Visit http://127.0.0.1:9999 to access the control api" + echo "Visit http://127.0.0.1:9090 to access the metrics api" + + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME \ + 8080:$CONTAINER_PORT_DEFAULT \ + 8185:$CONTAINER_PORT_PUBLIC \ + 9999:$CONTAINER_PORT_CONTROL \ + 9090:$CONTAINER_PORT_METRICS + {{- end }} diff --git a/deployment/helm/edc-dataplane/templates/deployment.yaml b/deployment/helm/edc-dataplane/templates/deployment.yaml index ee632461e..86a5eec9a 100644 --- a/deployment/helm/edc-dataplane/templates/deployment.yaml +++ b/deployment/helm/edc-dataplane/templates/deployment.yaml @@ -43,12 +43,12 @@ spec: - name: default containerPort: {{ .Values.edc.endpoints.default.port }} protocol: TCP - - name: control - containerPort: {{ .Values.edc.endpoints.control.port }} - protocol: TCP - name: public containerPort: {{ .Values.edc.endpoints.public.port }} protocol: TCP + - name: control + containerPort: {{ .Values.edc.endpoints.control.port }} + protocol: TCP - name: metrics containerPort: {{ .Values.edc.endpoints.metrics.port }} protocol: TCP diff --git a/deployment/helm/edc-dataplane/templates/ingress.yaml b/deployment/helm/edc-dataplane/templates/ingress.yaml index 58174d98f..cdcafb45a 100644 --- a/deployment/helm/edc-dataplane/templates/ingress.yaml +++ b/deployment/helm/edc-dataplane/templates/ingress.yaml @@ -1,4 +1,4 @@ -{{- if .Values.ingress.enabled -}} +{{- if .Values.ingress.enabled }} --- {{- $fullName := include "edc-dataplane.fullname" . -}} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} @@ -6,11 +6,11 @@ {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} {{- end }} {{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }} apiVersion: networking.k8s.io/v1beta1 -{{- else -}} +{{- else }} apiVersion: extensions/v1beta1 {{- end }} kind: Ingress @@ -22,11 +22,11 @@ metadata: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.ingress.certManager -}} - {{- if .Values.ingress.certManager.issuer -}} + {{- if .Values.ingress.certManager }} + {{- if .Values.ingress.certManager.issuer }} cert-manager.io/issuer: {{ .Values.ingress.certManager.issuer }} {{- end }} - {{- if .Values.ingress.certManager.clusterIssuer -}} + {{- if .Values.ingress.certManager.clusterIssuer }} cert-manager.io/cluster-issuer: {{ .Values.ingress.certManager.clusterIssuer }} {{- end }} {{- end }} @@ -45,12 +45,10 @@ spec: - host: {{ .Values.ingress.hostname }} http: paths: - {{ range $name, $mapping := .Values.edc.endpoints }} - {{ if $mapping.ingress -}} + {{- range $name, $mapping := .Values.edc.endpoints }} + {{- if $mapping.ingress }} - path: {{ $mapping.path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} pathType: Prefix - {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: diff --git a/deployment/helm/edc-dataplane/values.yaml b/deployment/helm/edc-dataplane/values.yaml index 6129ea6a4..08cb3c9de 100644 --- a/deployment/helm/edc-dataplane/values.yaml +++ b/deployment/helm/edc-dataplane/values.yaml @@ -1,3 +1,4 @@ +--- # Default values for edc-dataplane. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -86,16 +87,16 @@ edc: port: "8080" path: /api ingress: false - # Control API - control: - port: "9999" - path: /api/dataplane/control - ingress: true # Public endpoint for data transfer public: port: "8185" path: /api/public ingress: true + # Control API + control: + port: "9999" + path: /api/dataplane/control + ingress: true # Prometheus endpoint metrics: port: "9090" @@ -115,13 +116,13 @@ ingress: ## ## Set to true to enable ingress record generation ## - enabled: true + enabled: false ## ## Defines the ingress class to use https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class ## className: "" ## - ## En + ## Enables TLS on the ingress resource ## tls: false diff --git a/lintconf.yaml b/lintconf.yaml new file mode 100644 index 000000000..8fd25b1f8 --- /dev/null +++ b/lintconf.yaml @@ -0,0 +1,42 @@ +--- +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + require-starting-space: true + min-spaces-from-content: 2 + document-end: disable + document-start: true # No --- to start a file + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + hyphens: + max-spaces-after: 1 + indentation: + spaces: consistent + indent-sequences: whatever # - list indentation will handle both indentation and without + check-multi-line-strings: false + key-duplicates: enable + line-length: disable # Lines can be any length + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + level: warning