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

Helm Chart for pentaho-carte #32

Merged
merged 46 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f3b734f
Helm Chart for pentaho-carte
ejcsid Jun 18, 2024
658d1ed
disable Openshift route
ejcsid Jun 18, 2024
a477cf6
Changed appVersion to 0.0.2
ejcsid Jun 18, 2024
61a8d03
Correcting image repo path
ejcsid Jun 18, 2024
849950d
Resources configuration
ejcsid Jun 18, 2024
bc92f35
Merge branch 'main' into pentaho-carte
ejcsid Jun 18, 2024
c2652ec
Resources configuration for pentaho-carte
ejcsid Jun 18, 2024
1b9ac73
readiness & livenessProbe using curl
ejcsid Jun 18, 2024
d4275f4
Liveness & Readiness using httpGet with Authorization header
ejcsid Jun 18, 2024
b0e28a0
test-connection with basic-auth
ejcsid Jun 18, 2024
6947a8d
Test connection using curl
ejcsid Jun 18, 2024
cf8649a
Test connection using wget with header
ejcsid Jun 18, 2024
b124292
Test connection using wget with header
ejcsid Jun 18, 2024
2225467
Escaping header setting
ejcsid Jun 18, 2024
be74391
Escaping header setting
ejcsid Jun 18, 2024
61ac04b
added header option to command
ejcsid Jun 18, 2024
7488dd4
added header option before URL
ejcsid Jun 18, 2024
9f0c0cd
header and URL in same args
ejcsid Jun 18, 2024
fee2653
Helm Tests executing curl --help
ejcsid Jun 19, 2024
96878ee
Helm Tests using alpine/curl image with --user option
ejcsid Jun 19, 2024
3858ffa
Helm Tests alpine/curl command without args spec
ejcsid Jun 19, 2024
d31a64e
Corrected structure of test-connection.yaml
ejcsid Jun 19, 2024
b670144
Brackets around user:pwd
ejcsid Jun 19, 2024
c0d9de2
No --user argument with curl
ejcsid Jun 19, 2024
195d862
Using Image curlimages/curl
ejcsid Jun 19, 2024
1e672ba
user:password added to URL
ejcsid Jun 19, 2024
4567934
single line for each arg string
ejcsid Jun 19, 2024
7c06930
Helm Test using busybox with --header= command
ejcsid Jun 19, 2024
5b93030
Each argument a distinct entry in the list
ejcsid Jun 19, 2024
2ed677c
curlimages/curl curl http://cluster:cluster@
ejcsid Jun 19, 2024
9b6fe04
busybox ping
ejcsid Jun 19, 2024
dcbce51
ping -w 10
ejcsid Jun 19, 2024
27bc4da
ping -w 10 with brackets around number
ejcsid Jun 19, 2024
1f41700
c/p leftover fixed; wget --header
ejcsid Jun 24, 2024
bef759d
wget --header for pentaho-carte helm chart
ejcsid Jun 24, 2024
15a2158
c/p error fixed
ejcsid Jun 24, 2024
ae0a89c
Initial test-connection.yaml restored
ejcsid Jun 24, 2024
8257011
Switch back to ping
ejcsid Jun 24, 2024
7b6e31c
Executing wget hostname:port
ejcsid Jun 24, 2024
b3e28b8
Syntax command wget localhost:url changed
ejcsid Jun 24, 2024
091d6b1
added args --header
ejcsid Jun 24, 2024
c6cc15e
removed brackets around args
ejcsid Jun 24, 2024
b86e4a7
curl --user hostname:port
ejcsid Jun 24, 2024
28f5d02
curlimages/curl, curl --user hostname:port
ejcsid Jun 24, 2024
146e86d
curl --help
ejcsid Jun 24, 2024
682ead4
removed some comments
ejcsid Jun 24, 2024
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ values-local.yaml
!.vscode/extensions.json
!.vscode/*.code-snippets

### JetBrains IDEs ###
.idea
*.iml

# Local History for Visual Studio Code
.history/

Expand All @@ -27,4 +31,4 @@ values-local.yaml
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/helm,visualstudiocode
# End of https://www.toptal.com/developers/gitignore/api/helm,visualstudiocode
23 changes: 23 additions & 0 deletions charts/pentaho-carte/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions charts/pentaho-carte/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: pentaho-carte
description: Pentaho Data Integration installation and starts the Pentaho Carte Server
type: application
# Chart version.
version: 0.1.0
# Pentaho Dataintegration version
appVersion: "0.0.2"
maintainers:
- name: ejcsid
email: [email protected]
home: https://github.com/it-at-m/helm-charts/tree/main/charts/pentaho-carte
icon: https://opensource.muenchen.de/assets/itm-logo-256.png
sources:
- "https://github.com/it-at-m/helm-charts"
68 changes: 68 additions & 0 deletions charts/pentaho-carte/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# pentaho-carte

## Introduction

This chart bootstraps a [pentaho-carte](https://github.com/it-at-m/pentaho-carte) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Installing the Chart

Install this chart using:

```bash
helm install my-pentaho-carte-release it-at-m/pentaho-carte --values values.yaml
```

The command deploys pentaho-carte on the Kubernetes cluster with some default configuration. The [Configuration](#configuration) section lists the parameters that can or **must** be configured during installation.

## Configuration

| Key | Type | Default | Description |
|--------------------------------------------|--------|-------------------------|-----------------------------------------|
| replicaCount | int | `1` | Number of replicas |
| image.repository | string | `"itatm/pentaho-carte"` | Image to use for deploying |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.tag | string | `""` | Image tag |
| image.imagePullSecrets | list | `[]` | Image pull secrets specification |
| nameOverride | string | `""` | Override chart name |
| fullNameOverride | string | `""` | Override fullname |
| serviceAccount.create | bool | `false` | Create service account |
| serviceAccount.automount | bool | `false` | Mount Service account |
| serviceAccount.annotations | object | `{}` | Service account annotations |
| serviceAccount.name | string | `""` | Service account name |
| podAnnotations | object | `{}` | Pod annotations |
| podLabels | object | `{}` | Pod Labels |
| podSecurityContext | object | `{}` | Pod Security Context |
| securityContext | object | `{}` | Security Context |
| service.type | string | `"ClusterIP"` | Service type |
| service.port | int | `8080` | Service port |
| service.targetP ort | int | `8080` | Service target port |
| ingress.enabled | bool | `true` | Enable ingress |
| ingress.className | string | `""` | |
| ingress.annotations | object | `{}` | |
| ingress.hosts | list | `[]` | |
| ingress.tls | list | `[]` | |
| route.enabled | bool | `false` | Create OpenShift route |
| route.annotations | object | `{}` | Route annotations |
| route.host | string | `""` | Route host |
| route.path | string | `""` | Route path |
| route.wildcardPolicy | string | `"None"` | Route wildcard policy |
| route.tls.termination | string | `"Edge"` | Route tsl termination |
| route.tls.insecureEdgeTerminationPolicy | string | `"Redirect"` | Route tls insecureEdgeTerminationPolicy |
| route.tls.key | string | `""` | Route tls key |
| route.tls.certificate | string | `""` | Route tls certificate |
| route.tls.caCertificate | string | `""` | Route tls ca certificate |
| route.tls.destinationCACertificate | string | `""` | Route tls destination ca certificate |
| resources | object | `{}` | Pod resources |
| livenessProbe.httpGet.path | string | `/` | Path to use for liveness probe |
| livenessProbe.httpGet.port | string | `http` | Port to use for liveness probe |
| readinessProbe.httpGet.path | string | `/` | Path to use for readiness probe |
| readinessProbe.httpGet.port | string | `http` | Path to use for readiness probe |
| autoscaling.enabled | bool | `false` | Enable autoscaling |
| autoscaling.minReplicas | int | `1` | Minimal replicas |
| autoscaling.maxReplicas | int | `100` | Maximal replicas |
| autoscaling.targetCPUUtilizationPercentage | bool | `80` | CPU Utilization to use for autoscaling |
| volumes | list | `[]` | Additional Volumes |
| volumeMounts | list | `[]` | Additional volume mounts |
| nodeSelector | object | `{}` | Kubernetes node selector |
| tolerations | list | `[]` | Kubernetes tolerations |
| affinity | object | `{}` | Kubernetes node affinity |
22 changes: 22 additions & 0 deletions charts/pentaho-carte/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- 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 "pentaho-carte.fullname" . }})
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 its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "pentaho-carte.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "pentaho-carte.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pentaho-carte.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
{{- end }}
62 changes: 62 additions & 0 deletions charts/pentaho-carte/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pentaho-carte.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "pentaho-carte.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "pentaho-carte.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "pentaho-carte.labels" -}}
helm.sh/chart: {{ include "pentaho-carte.chart" . }}
{{ include "pentaho-carte.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "pentaho-carte.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pentaho-carte.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pentaho-carte.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "pentaho-carte.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
68 changes: 68 additions & 0 deletions charts/pentaho-carte/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pentaho-carte.fullname" . }}
labels:
{{- include "pentaho-carte.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "pentaho-carte.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pentaho-carte.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pentaho-carte.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 32 additions & 0 deletions charts/pentaho-carte/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pentaho-carte.fullname" . }}
labels:
{{- include "pentaho-carte.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "pentaho-carte.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
61 changes: 61 additions & 0 deletions charts/pentaho-carte/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "pentaho-carte.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- 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 -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "pentaho-carte.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Loading