From 15e823bf309b240904a8134b622d8ae6b966e26d Mon Sep 17 00:00:00 2001 From: Simple_Not <44047940+moonbaseDelta@users.noreply.github.com> Date: Mon, 19 Jun 2023 21:57:53 +1000 Subject: [PATCH] test helm --- charts/Chart.yaml | 10 ++++++++++ charts/templates/deployment.yaml | 24 ++++++++++++++++++++++++ charts/templates/service.yaml | 12 ++++++++++++ charts/values.yaml | 15 +++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 charts/Chart.yaml create mode 100644 charts/templates/deployment.yaml create mode 100644 charts/templates/service.yaml create mode 100644 charts/values.yaml diff --git a/charts/Chart.yaml b/charts/Chart.yaml new file mode 100644 index 0000000..14b89a5 --- /dev/null +++ b/charts/Chart.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v2 +name: nginx-chart +description: My First Helm Chart +type: application +version: 0.1.0 +appVersion: "1.0.0" +maintainers: +- email: vdk2ch@vdk2ch.ru + name: vdk2ch \ No newline at end of file diff --git a/charts/templates/deployment.yaml b/charts/templates/deployment.yaml new file mode 100644 index 0000000..449b05c --- /dev/null +++ b/charts/templates/deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.name }}-nginx + labels: + app: nginx +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP \ No newline at end of file diff --git a/charts/templates/service.yaml b/charts/templates/service.yaml new file mode 100644 index 0000000..fe80b40 --- /dev/null +++ b/charts/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service +spec: + selector: + app.kubernetes.io/instance: {{ .Release.Name }} + type: {{ .Values.service.type }} + ports: + - protocol: {{ .Values.service.protocol | default "TCP" }} + port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} \ No newline at end of file diff --git a/charts/values.yaml b/charts/values.yaml new file mode 100644 index 0000000..75a9780 --- /dev/null +++ b/charts/values.yaml @@ -0,0 +1,15 @@ +replicaCount: 1 + +image: + repository: nginx + tag: "1.16.0" + pullPolicy: IfNotPresent + +service: + name: nginx-service + type: ClusterIP + port: 80 + targetPort: 9000 + +env: + name: dev \ No newline at end of file