Skip to content
Snippets Groups Projects
Commit 8f5820db authored by OZGCloud's avatar OZGCloud
Browse files

if adapter helm chart init

parents
No related branches found
No related tags found
No related merge requests found
unit-tests/
\ No newline at end of file
apiVersion: v1
appVersion: "1.1"
description: A Helm chart for Intelliform Adapter
name: Intelliform Adapter
version: 0.1.0
icon: https://simpleicons.org/icons/helm.svg
# Intelliform Adapter
\ No newline at end of file
questions:
- variable: image.tag
default: snapshot-latest
type: string
label: The deployed version tag
group: "Image"
- variable: ingress.host
type: string
label: URL über die der Intelliform Adapter erreichbar ist
group: "Ingress"
- variable: env.springProfiles
type: string
label: Spring Profile für Intelliform Adapter
group: "Environment"
subquestions:
- variable: env.grpcName
label: gRPC Name
type: string
- variable: env.grpcValue
label: gRPC Value
type: string
{{/* vim: set filetype=mustache: */}}
{{/* Truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) */}}
{{/* Name */}}
{{- define "app.name" -}}
{{- default .Release.Name | toString | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Namespace */}}
{{- define "app.namespace" -}}
{{- default .Release.Namespace | toString | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Version */}}
{{- define "app.version" -}}
{{- default .Chart.Version | toString | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Chart: Name + Version */}}
{{- define "app.chart" -}}
{{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{/* Managed-by -> On Helm, this value is always Helm */}}
{{- define "app.managedBy" -}}
{{- default .Release.Service | toString | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}}
{{- define "app.defaultLabels" }}
app.kubernetes.io/instance: {{ include "app.name" . }}
app.kubernetes.io/managed-by: {{ include "app.managedBy" . }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/version: {{ include "app.version" . }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }}
helm.sh/chart: {{ include "app.chart" . }}
{{- end -}}
{{- define "app.matchLabels" }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}}
{{- define "app.imagePullSecret" }}
{{- with .Values.imageCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }}
labels:
{{- include "app.defaultLabels" . | indent 4 }}
spec:
progressDeadlineSeconds: 600
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "app.matchLabels" . | indent 6 }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
{{- include "app.defaultLabels" . | indent 8 }}
spec:
containers:
- env:
- name: {{ .Values.env.grpcName }}
value: {{ .Values.env.grpc }}
- name: spring_profiles_active
value: {{ .Values.env.springProfiles | default "oc" }}
image: "docker.ozg-sh.de/intelliform-adapter:{{ .Values.image.tag | default "snapshot-latest" }}"
imagePullPolicy: Always
name: intelliform-adapter
ports:
- containerPort: 8080
name: 8080tcp1
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/readiness
port: 8081
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
startupProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/readiness
port: 8081
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
resources:
limits:
cpu: {{ .Values.resources.limits.cpu | default "1" }}
memory: {{ .Values.resources.limits.memory | default "1200Mi" }}
requests:
cpu: {{ .Values.resources.requests.cpu | default "250m" }}
memory: {{ .Values.resources.requests.memory | default "800Mi" }}
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: false
stdin: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
tty: true
dnsConfig: {}
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: if-adapter-image-pull-secret
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
apiVersion: v1
kind: Secret
metadata:
name: if-adapter-image-pull-secret
namespace: {{ include "app.namespace" . }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ include "app.imagePullSecret" . }}
\ No newline at end of file
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }}
spec:
rules:
- http:
paths:
- backend:
service:
port:
number: 8080
name: {{ include "app.name" . }}
path: ''
pathType: ImplementationSpecific
host: {{ .Values.ingress.host }}
tls:
- hosts:
- {{ .Values.ingress.host }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }}
spec:
selector:
{{- include "app.matchLabels" . | indent 4 }}
type: ClusterIP
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
\ No newline at end of file
suite: test deployment
release:
name: intelliform-adapter
namespace: helm-test
templates:
- deployment.yaml
tests:
- it: should work
set:
image.tag: snapshot-latest
asserts:
- isKind:
of: Deployment
- equal:
path: spec.template.spec.containers[0].image
value: docker.ozg-sh.de/intelliform-adapter:snapshot-latest
\ No newline at end of file
replicaCount: 1
image:
tag: snapshot-latest # [default: snapshot-latest]
env:
springProfiles: oc # [default: oc]
grpcName: grpc_client_plutokiel_address
grpcValue: pluto-clusterip.sh-kiel-dev:9090
resources:
limits:
cpu: 1 # [default: 1]
memory: 1200Mi # [default: 1200Mi]
requests:
cpu: 500m # [default: 500m]
memory: 500Mi # [default: 500Mi]
imageCredentials:
registry: docker.ozg-sh.de
username: kop
password:
email: email@localhost
ingress:
host: afm.sh.stage.kop.ozg-sh.de
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment