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

Extend helm notes #35

Merged
merged 1 commit into from
Apr 26, 2022
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
57 changes: 57 additions & 0 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
#####################
### 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
38 changes: 38 additions & 0 deletions chart_schema.yaml
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 4 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
validate-maintainers: false
chart-dirs:
- deployment/helm
5 changes: 5 additions & 0 deletions deployment/helm/README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions deployment/helm/edc-controlplane/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
apiVersion: v2
name: edc-controlplane
description: EDC Control-Plane
home: https://github.com/catenax-ng/product-edc/deployment/helm/edc-controlplane
type: application
appVersion: "0.0.1"
version: 0.0.1
maintainers: []
74 changes: 59 additions & 15 deletions deployment/helm/edc-controlplane/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 3 additions & 3 deletions deployment/helm/edc-controlplane/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions deployment/helm/edc-controlplane/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{- 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)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := 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
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions deployment/helm/edc-controlplane/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Default values for edc-controlplane.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -335,4 +336,3 @@ configuration:
# edc.web.rest.cors.headers=
# edc.web.rest.cors.methods=
# edc.web.rest.cors.origins=

2 changes: 2 additions & 0 deletions deployment/helm/edc-dataplane/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
apiVersion: v2
name: edc-dataplane
description: EDC Data-Plane
home: https://github.com/catenax-ng/product-edc/deployment/helm/edc-dataplane
type: application
appVersion: "0.0.1"
version: 0.0.1
maintainers: []
64 changes: 49 additions & 15 deletions deployment/helm/edc-dataplane/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 3 additions & 3 deletions deployment/helm/edc-dataplane/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading