From bf0642fe787fd6a77345e6c178b8ba6e0bdaa99f Mon Sep 17 00:00:00 2001 From: jklein Date: Thu, 19 Mar 2026 12:09:30 +0100 Subject: [PATCH] feat(charts): added simple template chart --- template-chart/.helmignore | 23 +++++++++++++ template-chart/Chart.yaml | 11 ++++++ template-chart/templates/xxx.deployment.yaml | 36 ++++++++++++++++++++ template-chart/templates/xxx.ingress.yaml | 23 +++++++++++++ template-chart/templates/xxx.service.yaml | 13 +++++++ template-chart/values.yaml | 15 ++++++++ 6 files changed, 121 insertions(+) create mode 100644 template-chart/.helmignore create mode 100644 template-chart/Chart.yaml create mode 100644 template-chart/templates/xxx.deployment.yaml create mode 100644 template-chart/templates/xxx.ingress.yaml create mode 100644 template-chart/templates/xxx.service.yaml create mode 100644 template-chart/values.yaml diff --git a/template-chart/.helmignore b/template-chart/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/template-chart/.helmignore @@ -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/ diff --git a/template-chart/Chart.yaml b/template-chart/Chart.yaml new file mode 100644 index 0000000..00306f7 --- /dev/null +++ b/template-chart/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +name: xxx +description: A Helm chart to deploy xxx on Kubernetes + +type: application + +version: 1.0.0+upxxx +appVersion: "xxx" + +maintainers: + - name: jklein \ No newline at end of file diff --git a/template-chart/templates/xxx.deployment.yaml b/template-chart/templates/xxx.deployment.yaml new file mode 100644 index 0000000..a6c0724 --- /dev/null +++ b/template-chart/templates/xxx.deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + template: + metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + spec: + automountServiceAccountToken: false + containers: + - name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + image: "registry/image:{{ .Chart.AppVersion }}" + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + protocol: TCP + name: http + resources: + requests: + memory: "{{ .Values.xxx.resources.requests.memory }}" + cpu: "{{ .Values.xxx.resources.requests.cpu }}" + ephemeral-storage: "{{ .Values.xxx.resources.requests.ephemeralStorage }}" + limits: + memory: "{{ .Values.xxx.resources.limits.memory }}" + cpu: "{{ .Values.xxx.resources.limits.cpu }}" + ephemeral-storage: "{{ .Values.xxx.resources.limits.ephemeralStorage }}" + restartPolicy: Always diff --git a/template-chart/templates/xxx.ingress.yaml b/template-chart/templates/xxx.ingress.yaml new file mode 100644 index 0000000..b4c33cc --- /dev/null +++ b/template-chart/templates/xxx.ingress.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer}} +spec: + ingressClassName: nginx + rules: + - host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }}-service + port: + name: http + path: / + pathType: Prefix + tls: + - hosts: + - {{ required "A Domain/Host must be provided" .Values.ingress.domain }} + secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-ingress diff --git a/template-chart/templates/xxx.service.yaml b/template-chart/templates/xxx.service.yaml new file mode 100644 index 0000000..4c42512 --- /dev/null +++ b/template-chart/templates/xxx.service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-service +spec: + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + ports: + - protocol: TCP + port: 80 + targetPort: http + name: http + type: ClusterIP diff --git a/template-chart/values.yaml b/template-chart/values.yaml new file mode 100644 index 0000000..d1d559d --- /dev/null +++ b/template-chart/values.yaml @@ -0,0 +1,15 @@ +xxx: + resources: + requests: + cpu: 0.1 + memory: 512Mi + ephemeralStorage: 10Mi + limits: + cpu: 1 + memory: 768Mi + ephemeralStorage: 100Mi + +ingress: + enabled: true + clusterIssuer: letsencrypt + domain: null \ No newline at end of file