From b2d089b946907116f45b8eb63f2dc2c626e6d5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=9C=D1=83=D1=80?= =?UTF-8?q?=D0=B0=D1=88=D0=B5=D0=B2?= Date: Sat, 20 Jan 2024 14:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=BD=D0=B8=D1=86=D0=B8=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20hello-word=20=D1=8B=20?= =?UTF-8?q?=D1=80=D0=B5=D0=BF=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hello-word-0.1.0.tgz | Bin 0 -> 3964 bytes hello-word/.helmignore | 23 ++++ hello-word/Chart.yaml | 24 +++++ hello-word/templates/NOTES.txt | 22 ++++ hello-word/templates/_helpers.tpl | 62 +++++++++++ hello-word/templates/deployment.yaml | 72 +++++++++++++ hello-word/templates/hpa.yaml | 32 ++++++ hello-word/templates/ingress.yaml | 61 +++++++++++ hello-word/templates/service.yaml | 15 +++ hello-word/templates/serviceaccount.yaml | 13 +++ .../templates/tests/test-connection.yaml | 15 +++ hello-word/values.yaml | 98 ++++++++++++++++++ index.yaml | 14 +++ 13 files changed, 451 insertions(+) create mode 100644 hello-word-0.1.0.tgz create mode 100644 hello-word/.helmignore create mode 100644 hello-word/Chart.yaml create mode 100644 hello-word/templates/NOTES.txt create mode 100644 hello-word/templates/_helpers.tpl create mode 100644 hello-word/templates/deployment.yaml create mode 100644 hello-word/templates/hpa.yaml create mode 100644 hello-word/templates/ingress.yaml create mode 100644 hello-word/templates/service.yaml create mode 100644 hello-word/templates/serviceaccount.yaml create mode 100644 hello-word/templates/tests/test-connection.yaml create mode 100644 hello-word/values.yaml create mode 100644 index.yaml diff --git a/hello-word-0.1.0.tgz b/hello-word-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..c1f657dd8580741a349c1ea943f0a3b07e766e5b GIT binary patch literal 3964 zcmV-?4}Dc zVQyr3R8em|NM&qo0PH;dbKAI%{aJqn&dHm8TrJyaK6;wz-Q?2VzRb3%r^)us&dyGU zmSCG3iqw*n6R(^5+ux9sEJ~JRx6MoU&4xcD`TzkCBtQ^=JVnMt_e#j5cQPeXhjWs$ zM|a!${eJ&&f8YM^_xsKN{lU?}qrv{c!QSEF!QtTGQGf7a@9^jm^zWFD)|M+x9V5`N4_C^>3W z0VgR&P%WrH&ohjGWErC|G5v#CiMt;T!hZ0*2mjC>dHO#iEJyV(FaR6$fB(hcsHy)4 zdk^}5FKq{2L0IxA-L?X8hw%=NL=WDuQ2rwRWu}VZp{ZV=E5>g>pt?JdR^KB+J=(hA|yeRB$y# zJw*uw3OFDR5Y$xUEHUzmB@&HE0L4`VTIOgG9p_r4MAMisHiy)9Bye6M`B=g6@YM88 zkZVeq`kw%Rn4V6^6*kU=wiek=6-g5F&q$}ioatY|MzFZC{V%2nMgSnjZM_V#Tw!Qo zPshN8289|3Pl}P*$&fid2jUP>1ry{b&G;c#lus<;Qqs$n69Bkv#z;I9$#H|bOeAl~ z2${Pxx91q=lIr=1;2N*>atvejgA{od!Ct@LH?!9c7L$yOD5IL9a&rohNRgG-T{wRG z)?P~_$$QS`AB52VM;WTQ(wKTumpMOHXM!7m=Hs6f$_NGpD^{9@g4;n)Sgth6)1grW zA$0^V`$0hYM53}xAvbE5L@*{y8LTlQN}ZL0YMVqu`Et2;hg9?me4*`IY2GTJW~xhK zi`xvs;GYVmEhk1G<|cA_*2Qa*W(-3nV#4fufQ;yA0qi=M2NCp^PaMdF9s8;2o+5YL z7y1+%(J-f-b{e{%tirk>*GP9YQ^j0WZ0?k#+qeuQDv`?=s|EiLgk0rT_aw$5O_3*d zS!)5x@-$!CnPqRg-n9URWQL%P6(z=s#)7MuirldkPl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MJ2HjoG<;>9Q_^T5V1nx&1pOH$qK3n$0eFt&y8cRfly#aa;MR6Jxs% zQZ49j_cq!BRV|ZmAy)!SGc=;<7?>HL$wIxacxS zsC|(a^`Glt%P&hBC(ELjS4-+z*YfJ;1N~l&XkS$uZ#q@?tzJg$M&=ARj-kd}`F)I` zWGhuyShR&yOLiMy%dD%Ft;X%bJN4?xK9qJOd0>i?Hc+Wq+d{e#23)%w4O_|Ltx+V4MCoJ>+c^u{Qk?mv{tnqiljxCJ6mo3-Nv%%e7jDs zsA#7wNS+FD*@?iATzU=7@|d#H<7$H1FBXbml&kqjTrbON?ANUk{PNg+-0Z{E6giA?$`Z;akdgS3Oi(R<3rgjg^}9it)dLeIMy_g-^2u|M$cUyhv{4}M zIpImL0~{yr3-c$L#4)|b#BJCA@ic_@oXtUS+taWF8A|&rBViD}KL2#Cg~VV7ifLbtW@wUR99K>EF6)` z;900sb1fvD1ke6I*ny8kQjse-ef>rSVJ5|I80#RU36h=zm*Te|oT*qO*!z>Y`VZ}) WJ+y~bYyS)Y0RR8l!RkZ+RsaA5tJYuu literal 0 HcmV?d00001 diff --git a/hello-word/.helmignore b/hello-word/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/hello-word/.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/hello-word/Chart.yaml b/hello-word/Chart.yaml new file mode 100644 index 0000000..f9e634a --- /dev/null +++ b/hello-word/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: hello-word +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. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.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. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/hello-word/templates/NOTES.txt b/hello-word/templates/NOTES.txt new file mode 100644 index 0000000..3c78408 --- /dev/null +++ b/hello-word/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hello-word.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hello-word.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hello-word.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hello-word.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/hello-word/templates/_helpers.tpl b/hello-word/templates/_helpers.tpl new file mode 100644 index 0000000..c5e93d1 --- /dev/null +++ b/hello-word/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "hello-word.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "hello-word.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "hello-word.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "hello-word.labels" -}} +helm.sh/chart: {{ include "hello-word.chart" . }} +{{ include "hello-word.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "hello-word.selectorLabels" -}} +app.kubernetes.io/name: {{ include "hello-word.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "hello-word.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "hello-word.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/hello-word/templates/deployment.yaml b/hello-word/templates/deployment.yaml new file mode 100644 index 0000000..1543369 --- /dev/null +++ b/hello-word/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "hello-word.fullname" . }} + labels: + {{- include "hello-word.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "hello-word.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "hello-word.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "hello-word.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/hello-word/templates/hpa.yaml b/hello-word/templates/hpa.yaml new file mode 100644 index 0000000..8f3a5f0 --- /dev/null +++ b/hello-word/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "hello-word.fullname" . }} + labels: + {{- include "hello-word.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "hello-word.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/hello-word/templates/ingress.yaml b/hello-word/templates/ingress.yaml new file mode 100644 index 0000000..47fe8b0 --- /dev/null +++ b/hello-word/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "hello-word.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "hello-word.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/hello-word/templates/service.yaml b/hello-word/templates/service.yaml new file mode 100644 index 0000000..e420d3f --- /dev/null +++ b/hello-word/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "hello-word.fullname" . }} + labels: + {{- include "hello-word.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "hello-word.selectorLabels" . | nindent 4 }} diff --git a/hello-word/templates/serviceaccount.yaml b/hello-word/templates/serviceaccount.yaml new file mode 100644 index 0000000..cbc2fae --- /dev/null +++ b/hello-word/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "hello-word.serviceAccountName" . }} + labels: + {{- include "hello-word.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/hello-word/templates/tests/test-connection.yaml b/hello-word/templates/tests/test-connection.yaml new file mode 100644 index 0000000..cf517dd --- /dev/null +++ b/hello-word/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "hello-word.fullname" . }}-test-connection" + labels: + {{- include "hello-word.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "hello-word.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/hello-word/values.yaml b/hello-word/values.yaml new file mode 100644 index 0000000..782ca00 --- /dev/null +++ b/hello-word/values.yaml @@ -0,0 +1,98 @@ +# Default values for hello-word. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/index.yaml b/index.yaml new file mode 100644 index 0000000..fa5607b --- /dev/null +++ b/index.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +entries: + hello-word: + - apiVersion: v2 + appVersion: 1.16.0 + created: "2024-01-20T14:44:08.3120914+08:00" + description: A Helm chart for Kubernetes + digest: 46ad2afecd7c2602443580b1e63154fe9571452285feb4580c132a0b91b8b012 + name: hello-word + type: application + urls: + - hello-word-0.1.0.tgz + version: 0.1.0 +generated: "2024-01-20T14:44:08.3108761+08:00"