From e7fad56d0bb2fec970427864d2c02019878c8653 Mon Sep 17 00:00:00 2001 From: jun6292 Date: Fri, 11 Oct 2024 18:57:40 +0000 Subject: [PATCH] =?UTF-8?q?[Feat]=20Helm=20=EC=B0=A8=ED=8A=B8=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm/Chart.yaml | 5 +++++ helm/templates/_helpers.tpl | 12 ++++++++++++ helm/templates/deployment.yaml | 19 +++++++++++++++++++ helm/templates/service.yaml | 11 +++++++++++ helm/values.yaml | 13 +++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/_helpers.tpl create mode 100644 helm/templates/deployment.yaml create mode 100644 helm/templates/service.yaml create mode 100644 helm/values.yaml diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..5793b58 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: jenkins-inven-collector +description: A Helm chart for deploying the Jenkins Inventory Collector +version: 0.1.0 +appVersion: "1.0" \ No newline at end of file diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl new file mode 100644 index 0000000..aeb5528 --- /dev/null +++ b/helm/templates/_helpers.tpl @@ -0,0 +1,12 @@ +{{/* Generate the full name of the application */}} +{{- define "my-app.name" -}} +{{- .Chart.Name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "my-app.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else }} +{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}-{{ .Release.Name | trunc 63 | trimSuffix "-" }} +{{- end -}} +{{- end -}} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 0000000..75125e7 --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "my-app.fullname" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "my-app.fullname" . }} + template: + metadata: + labels: + app: {{ include "my-app.fullname" . }} + spec: + containers: + - name: jenkins-inven-collector + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - containerPort: 50051 \ No newline at end of file diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 0000000..0f81b62 --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "my-app.fullname" . }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 50051 + selector: + app: {{ include "my-app.fullname" . }} \ No newline at end of file diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..19dec81 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,13 @@ +replicaCount: 2 + +image: + repository: chanjin/plugin-jenkins-inven-collector + tag: latest + pullPolicy: IfNotPresent + +service: + type: ClusterIP + port: 50051 + +ingress: + enabled: false \ No newline at end of file