From 594e801fdf20814fa180f472462ff80b36b1eb86 Mon Sep 17 00:00:00 2001 From: wenyang0 Date: Wed, 20 Nov 2024 13:18:30 +0800 Subject: [PATCH 1/3] Add Helm Chart Deploy --- helm/Chart.yaml | 26 +++++ helm/README.md | 15 +++ helm/it-tools-1.0.0.tgz | Bin 0 -> 4396 bytes helm/templates/NOTES.txt | 22 ++++ helm/templates/_helpers.tpl | 62 +++++++++++ helm/templates/deployment.yaml | 68 ++++++++++++ helm/templates/hpa.yaml | 32 ++++++ helm/templates/ingress.yaml | 43 ++++++++ helm/templates/service.yaml | 15 +++ helm/templates/serviceaccount.yaml | 13 +++ helm/templates/tests/test-connection.yaml | 15 +++ helm/values.yaml | 124 ++++++++++++++++++++++ 12 files changed, 435 insertions(+) create mode 100644 helm/Chart.yaml create mode 100644 helm/README.md create mode 100644 helm/it-tools-1.0.0.tgz create mode 100644 helm/templates/NOTES.txt create mode 100644 helm/templates/_helpers.tpl create mode 100644 helm/templates/deployment.yaml create mode 100644 helm/templates/hpa.yaml create mode 100644 helm/templates/ingress.yaml create mode 100644 helm/templates/service.yaml create mode 100644 helm/templates/serviceaccount.yaml create mode 100644 helm/templates/tests/test-connection.yaml create mode 100644 helm/values.yaml diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 000000000..81995bf00 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,26 @@ +apiVersion: v2 +name: it-tools +description: Collection of handy online tools for developers, with great UX. + +# 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: 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. 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: "v2024.10.22" + +icon: https://it-tools.tech/favicon.ico diff --git a/helm/README.md b/helm/README.md new file mode 100644 index 000000000..efa1a4d97 --- /dev/null +++ b/helm/README.md @@ -0,0 +1,15 @@ +## Helm Chart deploy + +```sh +# Download code locally +git clone https://github.com/CorentinTh/it-tools.git + +#change directory +cd it-tools/helm + +#Start installation +helm install it-tools -f values.yaml ./ + +# Browser access +http://NodeIpAddress:30088 +``` diff --git a/helm/it-tools-1.0.0.tgz b/helm/it-tools-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..8342cfd424cff58c60a204dfc08bb6020eeaa200 GIT binary patch literal 4396 zcmV+{5!3D;iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH;dbKAC({h5Eoo}4#nbK!?<$IfsjbK_^{z2~{a(b#F;bvm5} zB3BY>h+qLww(9u)_8WZgQ@F7A59}^Um9IEwGCZCUp@Jouvv2OZ zMNt$T?C+cZQ51FmM|;ElZ-)Da!^7Pdhta`{Z=&Ju;fup>Ai8%-dRieB5#K~#jH^4j zzepoF{eVJJp2e`(^+=vKE~DN3U>F6vyIzVi5j0ok!7*nH6a5?b1ZE^lm%uYdGX%4j zV8R8YxIo5p6!JM-Q8k09K%(IL{|P*rXecwKav6tVxdQ`*$t;|Zg?=2+gnJp8V+`eU zPc3tdf#f-(3DMZSMM>%~h=R!b+PwTLwo3jNgcT_N5Cw3z{12mH6m{f(Z#R0B{|9M1 zaDo$3Fa>r47}>2v(%XUeGb({fAn?P{+c*A%i#bsWQN>Cie z2sx1wQ=pmRu;hgRh4Y*dg);C;xL1@hkf=b-5Cj^@)|Uw{G6i!k5NKvmYHgE{OhcaV zB1>V00&6XDS&UI+sG(CHraX~h!m|W(CBrK&E*U4Oxut~GUP6X7y3ljKk2TsDh82Ah zl{B>JfrMr#fX>Mj?~Swyt_%%e8G7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Oi}ljPv$3UU{s@6h3v&7A+TW(8V%pl&`M9t7}`^^qCk|d%h*Z zOqv{8trh5MVd+LI+v9S<6;C*e;r;Qb@oXjEe<#;lz3<@pYC*uAVB6jAgj*JKYzA4@ z$gGF9BEPMqcB^YEdA%0*23##6UW2@Wx6I>ziK^ zo<{n=?$xXb_W)RwwAmI^ z17G7AS)d?OY&={$wdGZe56i;l??%h%4Vk(U?p@-wKJQ^rRxU^JdDrlEQl4wsyW5UK0hb4|7TT{>*e1S3EYDk*d+f4(P20Ld$@P- zDE|-9wyNalo&vgx!gb$PU)+&ByWc}VXEyhE7O1{W(dNK=eu-J18mdSr$NgD+s2=%O zD3$%|Cp^pSTcls21~%IN!-KZ`??$`P^03&C}7)%)-+sY}LO`n56MigD3iI6nzlPvXi zAj7GB!}Qx+;DladYEAZkd>6pGj4gp@W~3$waunuM6@eF=T>N~YxIk|QTqW~|;|oZs zkX|sQDl~sB`Cc&oO@!ued1E#W^`G)mF0!x&G$zSqk(=+?N$*)8uX68MFeaDYvp~)D zZ!YN6d-lKH4tyYj@n z!F*$fExjpKkT5N%<%dD0RLzQUknnkU?7md^zW!377ERCFNoFP-n^Iwp$xAOut1nH4 z+WL6j&V{y-V5;32vpF;Uq`Xu02Y&*MFO~uXq37+u-vz&tD1amhO6j?`6VG^xr}>e6 mLpin|hWhyN<6l8MAKPPlY>({^YyTGj0RR8D503=^UH||OTaqpS literal 0 HcmV?d00001 diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt new file mode 100644 index 000000000..438fc9b9c --- /dev/null +++ b/helm/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 "it-tools.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 its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "it-tools.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "it-tools.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 "it-tools.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/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl new file mode 100644 index 000000000..2597e2b3f --- /dev/null +++ b/helm/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "it-tools.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 "it-tools.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 "it-tools.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "it-tools.labels" -}} +helm.sh/chart: {{ include "it-tools.chart" . }} +{{ include "it-tools.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "it-tools.selectorLabels" -}} +app.kubernetes.io/name: {{ include "it-tools.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "it-tools.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "it-tools.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 000000000..1431e824e --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "it-tools.fullname" . }} + labels: + {{- include "it-tools.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "it-tools.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "it-tools.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "it-tools.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: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + 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/helm/templates/hpa.yaml b/helm/templates/hpa.yaml new file mode 100644 index 000000000..436e6a314 --- /dev/null +++ b/helm/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "it-tools.fullname" . }} + labels: + {{- include "it-tools.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "it-tools.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/helm/templates/ingress.yaml b/helm/templates/ingress.yaml new file mode 100644 index 000000000..be2b27f7c --- /dev/null +++ b/helm/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "it-tools.fullname" . }} + labels: + {{- include "it-tools.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- 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 }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "it-tools.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 000000000..81d1fb726 --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "it-tools.fullname" . }} + labels: + {{- include "it-tools.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "it-tools.selectorLabels" . | nindent 4 }} diff --git a/helm/templates/serviceaccount.yaml b/helm/templates/serviceaccount.yaml new file mode 100644 index 000000000..620dc4d50 --- /dev/null +++ b/helm/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "it-tools.serviceAccountName" . }} + labels: + {{- include "it-tools.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/templates/tests/test-connection.yaml b/helm/templates/tests/test-connection.yaml new file mode 100644 index 000000000..b5b379836 --- /dev/null +++ b/helm/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "it-tools.fullname" . }}-test-connection" + labels: + {{- include "it-tools.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "it-tools.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 000000000..b17cd28d7 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,124 @@ +# Default values for it-tools. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + repository: corentinth/it-tools + # This sets the pull policy for images. + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +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: "" + +# This is for setting Kubernetes Annotations to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} +# This is for setting Kubernetes Labels to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + type: NodePort + port: 80 + nodePort: 30088 + + +# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ +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 + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +#This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +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: {} From 70ee48b4a7d6a350e80a17259ef342a98bf1ddee Mon Sep 17 00:00:00 2001 From: wenyang0 Date: Wed, 20 Nov 2024 13:33:54 +0800 Subject: [PATCH 2/3] Add k8s NodePort --- helm/it-tools-1.0.0.tgz | Bin 4396 -> 0 bytes helm/templates/service.yaml | 1 + 2 files changed, 1 insertion(+) delete mode 100644 helm/it-tools-1.0.0.tgz diff --git a/helm/it-tools-1.0.0.tgz b/helm/it-tools-1.0.0.tgz deleted file mode 100644 index 8342cfd424cff58c60a204dfc08bb6020eeaa200..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4396 zcmV+{5!3D;iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH;dbKAC({h5Eoo}4#nbK!?<$IfsjbK_^{z2~{a(b#F;bvm5} zB3BY>h+qLww(9u)_8WZgQ@F7A59}^Um9IEwGCZCUp@Jouvv2OZ zMNt$T?C+cZQ51FmM|;ElZ-)Da!^7Pdhta`{Z=&Ju;fup>Ai8%-dRieB5#K~#jH^4j zzepoF{eVJJp2e`(^+=vKE~DN3U>F6vyIzVi5j0ok!7*nH6a5?b1ZE^lm%uYdGX%4j zV8R8YxIo5p6!JM-Q8k09K%(IL{|P*rXecwKav6tVxdQ`*$t;|Zg?=2+gnJp8V+`eU zPc3tdf#f-(3DMZSMM>%~h=R!b+PwTLwo3jNgcT_N5Cw3z{12mH6m{f(Z#R0B{|9M1 zaDo$3Fa>r47}>2v(%XUeGb({fAn?P{+c*A%i#bsWQN>Cie z2sx1wQ=pmRu;hgRh4Y*dg);C;xL1@hkf=b-5Cj^@)|Uw{G6i!k5NKvmYHgE{OhcaV zB1>V00&6XDS&UI+sG(CHraX~h!m|W(CBrK&E*U4Oxut~GUP6X7y3ljKk2TsDh82Ah zl{B>JfrMr#fX>Mj?~Swyt_%%e8G7b_?1AP7msD}Fj3MCyGet8stMsJ@(4{gj7=xTM znk?-)8jyhp=E=x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zOqv{8trh5MVd+LI+v9S<6;C*e;r;Qb@oXjEe<#;lz3<@pYC*uAVB6jAgj*JKYzA4@ z$gGF9BEPMqcB^YEdA%0*23##6UW2@Wx6I>ziK^ zo<{n=?$xXb_W)RwwAmI^ z17G7AS)d?OY&={$wdGZe56i;l??%h%4Vk(U?p@-wKJQ^rRxU^JdDrlEQl4wsyW5UK0hb4|7TT{>*e1S3EYDk*d+f4(P20Ld$@P- zDE|-9wyNalo&vgx!gb$PU)+&ByWc}VXEyhE7O1{W(dNK=eu-J18mdSr$NgD+s2=%O zD3$%|Cp^pSTcls21~%IN!-KZ`??$`P^03&C}7)%)-+sY}LO`n56MigD3iI6nzlPvXi zAj7GB!}Qx+;DladYEAZkd>6pGj4gp@W~3$waunuM6@eF=T>N~YxIk|QTqW~|;|oZs zkX|sQDl~sB`Cc&oO@!ued1E#W^`G)mF0!x&G$zSqk(=+?N$*)8uX68MFeaDYvp~)D zZ!YN6d-lKH4tyYj@n z!F*$fExjpKkT5N%<%dD0RLzQUknnkU?7md^zW!377ERCFNoFP-n^Iwp$xAOut1nH4 z+WL6j&V{y-V5;32vpF;Uq`Xu02Y&*MFO~uXq37+u-vz&tD1amhO6j?`6VG^xr}>e6 mLpin|hWhyN<6l8MAKPPlY>({^YyTGj0RR8D503=^UH||OTaqpS diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index 81d1fb726..1f7563191 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -8,6 +8,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} + nodePort: {{ .Values.service.nodePort}} targetPort: http protocol: TCP name: http From 7360e7cdedeffd4c9bfc9fbf0d9bf150f607eae2 Mon Sep 17 00:00:00 2001 From: wenyang0 Date: Wed, 20 Nov 2024 13:35:31 +0800 Subject: [PATCH 3/3] add readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 8bf7616bb..d6526bb6a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,22 @@ docker run -d --name it-tools --restart unless-stopped -p 8080:80 corentinth/it- docker run -d --name it-tools --restart unless-stopped -p 8080:80 ghcr.io/corentinth/it-tools:latest ``` +## Helm Chart deploy + +```sh +# Download code locally +git clone https://github.com/CorentinTh/it-tools.git + +#change directory +cd it-tools/helm + +#Start installation +helm install it-tools -f values.yaml ./ + +# Browser access +http://NodeIpAddress:30088 +``` + **Other solutions:** - [Cloudron](https://www.cloudron.io/store/tech.ittools.cloudron.html)