Skip to content

Commit

Permalink
Merge pull request #5 from GPP-Woo/chart-burgerportaal
Browse files Browse the repository at this point in the history
add chart for burgerportaal
  • Loading branch information
felixcicatt authored Dec 16, 2024
2 parents d2abee1 + c2016be commit a7c31e0
Show file tree
Hide file tree
Showing 12 changed files with 535 additions and 0 deletions.
10 changes: 10 additions & 0 deletions charts/GPP-burgerportaal/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: gpp-burgerportaal
description: A helm chart for the ICATT GPP burgerportaal.

type: application

# Chart version
version: 0.1.0
appVersion: 0.0.0

77 changes: 77 additions & 0 deletions charts/GPP-burgerportaal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# gpp-burgerportaal

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)

A helm chart for the ICATT GPP Burgerportaal.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| autoscaling.targetMemoryUtilizationPercentage | int | `80` | |
| azureVaultSecret.contentType | string | `""` | |
| azureVaultSecret.objectName | string | `""` | |
| azureVaultSecret.secretName | string | `"{{ .Values.existingSecret }}"` | |
| azureVaultSecret.vaultName | string | `nil` | |
| existingSecret | string | `nil` | |
| extraIngress | list | `[]` | Specify extra ingresses, for example if you have multiple ingress classes |
| fullnameOverride | string | `""` | |
| global.settings.databaseHost | string | `""` | Global databasehost, overrides setting.database.host |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/gpp-woo/gpp-burgerportaal"` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts | list | `[]` | ingress hosts |
| ingress.tls | list | `[]` | |
| livenessProbe.failureThreshold | int | `6` | |
| livenessProbe.initialDelaySeconds | int | `60` | |
| livenessProbe.periodSeconds | int | `10` | |
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `5` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| pdb.create | bool | `false` | |
| pdb.maxUnavailable | string | `""` | |
| pdb.minAvailable | int | `1` | |
| persistence.enabled | bool | `true` | |
| persistence.existingClaim | string | `nil` | |
| persistence.size | string | `"1Gi"` | |
| persistence.storageClassName | string | `""` | |
| podAnnotations | object | `{}` | |
| podLabels | object | `{}` | |
| podSecurityContext.fsGroup | int | `1000` | |
| readinessProbe.failureThreshold | int | `6` | |
| readinessProbe.initialDelaySeconds | int | `30` | |
| readinessProbe.periodSeconds | int | `10` | |
| readinessProbe.successThreshold | int | `1` | |
| readinessProbe.timeoutSeconds | int | `5` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| securityContext.readOnlyRootFilesystem | bool | `false` | |
| securityContext.runAsNonRoot | bool | `true` | |
| securityContext.runAsUser | int | `1000` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.automountServiceAccountToken | bool | `true` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| settings.aspnetcore.environment | string | `""` | |
| settings.aspnetcore.forwardedHeadersEnabled | bool | `true` | |
| settings.aspnetcore.httpPorts | string | `""` | |
| settings.redirectUrl | string | `""` | |
| settings.sitemapCacheDurationHours | int | `nil` | |
| settings.downloadTimeoutMinutes | int | `nil` | |
| settings.gppPublicatiebank.apiKey | string | `""` | |
| settings.gppPublicatiebank.baseUrl | string | `""` | |
| tolerations | list | `[]` | |

62 changes: 62 additions & 0 deletions charts/GPP-burgerportaal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "gpp-burgerportaal.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 "gpp-burgerportaal.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 "gpp-burgerportaal.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "gpp-burgerportaal.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "gpp-burgerportaal.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/GPP-burgerportaal/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
data:
ODRC_BASE_URL: {{ .Values.settings.gppPublicatiebank.baseUrl | toString | quote }}
REDIRECT_URL: {{ .Values.settings.redirectUrl | toString | quote }}
{{- if .Values.settings.sitemapCacheDurationHours }}
SITEMAP_CACHE_DURATION_HOURS: {{ .Values.settings.sitemapCacheDurationHours }}
{{- end }}
{{- if .Values.settings.downloadTimeoutMinutes }}
DOWNLOAD_TIMEOUT_MINUTES: {{ .Values.settings.downloadTimeoutMinutes }}
{{- end }}
81 changes: 81 additions & 0 deletions charts/GPP-burgerportaal/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# Application Burgerportaal
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "gpp-burgerportaal.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "gpp-burgerportaal.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 }}
envFrom:
- secretRef:
name: {{ .Values.existingSecret | default (include "gpp-burgerportaal.fullname" .) }}
- configMapRef:
name: {{ include "gpp-burgerportaal.fullname" . }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: http
httpHeaders:
- name: Host
value: {{ include "gpp-burgerportaal.fullname" . | quote }}
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: /healthz
port: http
httpHeaders:
- name: Host
value: {{ include "gpp-burgerportaal.fullname" . | quote }}
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- 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/GPP-burgerportaal/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 "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "gpp-burgerportaal.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 }}
43 changes: 43 additions & 0 deletions charts/GPP-burgerportaal/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- 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 }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ include "gpp-burgerportaal.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}
19 changes: 19 additions & 0 deletions charts/GPP-burgerportaal/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.pdb.create }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
spec:
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- end }}
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "gpp-burgerportaal.selectorLabels" . | nindent 6 }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/GPP-burgerportaal/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if not .Values.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
stringData:
ODRC_API_KEY: {{ .Values.settings.gppPublicatiebank.apiKey | toString | quote }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/GPP-burgerportaal/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "gpp-burgerportaal.fullname" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 8080
protocol: TCP
name: http
selector:
{{- include "gpp-burgerportaal.selectorLabels" . | nindent 4 }}
13 changes: 13 additions & 0 deletions charts/GPP-burgerportaal/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "gpp-burgerportaal.serviceAccountName" . }}
labels:
{{- include "gpp-burgerportaal.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
Loading

0 comments on commit a7c31e0

Please sign in to comment.