From 7825ac6a05bb541ecd7396af8990e892e8310919 Mon Sep 17 00:00:00 2001 From: vitaliy Date: Thu, 13 Nov 2025 15:41:24 +0300 Subject: [PATCH] k8s: helm manifest --- .idea/.gitignore | 3 +++ .idea/go_simple.iml | 8 +++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 ++++++ helm/Chart.yaml | 21 +++++++++++++++++++ helm/templates/deployment.yaml | 21 +++++++++++++++++++ helm/templates/ingress.yaml | 20 ++++++++++++++++++ helm/templates/service.yaml | 12 +++++++++++ helm/values.dev.yaml | 1 + helm/values.yaml | 4 ++++ 12 files changed, 114 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/go_simple.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/deployment.yaml create mode 100644 helm/templates/ingress.yaml create mode 100644 helm/templates/service.yaml create mode 100644 helm/values.dev.yaml create mode 100644 helm/values.yaml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/go_simple.iml b/.idea/go_simple.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/go_simple.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..dc9ea49 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..480d115 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..e4adadd --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: helloworld +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 1.0.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.0.0 \ No newline at end of file diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 0000000..118f1df --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: go_hello + labels: + app: go_hello +spec: + replicas: {{ .values.replicaCount }} + selector: + matchLabels: + app: go_hello + template: + metadata: + labels: + app: go_hello + spec: + containers: + - name: go_hello + image: "git.gocommunity.ru/go-hello:{{ .Chart.AppVersion }}" + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yaml new file mode 100644 index 0000000..11f5f3d --- /dev/null +++ b/helm/templates/ingress.yaml @@ -0,0 +1,20 @@ +{{- if .values.ingress.enabled -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: helloworld + namespace: default + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/group.name: default + alb.ingress.kubernetes.io/target-type: ip +spec: + rules: + - http: + paths: + - path: /* + backend: + serviceName: helloworld + servicePort: 80 +{{- end -}} \ No newline at end of file diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 0000000..462079e --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: go_hello_service + labels: + app: go_hello_service +spec: + selector: + app: go_hello + ports: + - port: 81 + targetPort: 8080 \ No newline at end of file diff --git a/helm/values.dev.yaml b/helm/values.dev.yaml new file mode 100644 index 0000000..d6b6855 --- /dev/null +++ b/helm/values.dev.yaml @@ -0,0 +1 @@ +replicaCount: 1 \ No newline at end of file diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..516cb95 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,4 @@ +replicaCount: 3 + +ingress: + enabled: true \ No newline at end of file