This repository was archived by the owner on Apr 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +256
-0
lines changed Expand file tree Collapse file tree 9 files changed +256
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Patterns to ignore when building packages.
2
+ # This supports shell glob matching, relative path matching, and
3
+ # negation (prefixed with !). Only one pattern per line.
4
+ .DS_Store
5
+ # Common VCS dirs
6
+ .git/
7
+ .gitignore
8
+ .bzr/
9
+ .bzrignore
10
+ .hg/
11
+ .hgignore
12
+ .svn/
13
+ # Common backup files
14
+ *.swp
15
+ *.bak
16
+ *.tmp
17
+ *~
18
+ # Various IDEs
19
+ .project
20
+ .idea/
21
+ *.tmproj
22
+ .vscode/
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ appVersion : " 1.0"
3
+ description : A Helm chart for Kubernetes
4
+ name : magento2-helm
5
+ version : 0.1.0
Original file line number Diff line number Diff line change
1
+ 1. Get the application URL by running these commands:
2
+ {{- if .Values.ingress.enabled }}
3
+ {{- range $host := .Values.ingress.hosts }}
4
+ {{- range $.Values.ingress.paths }}
5
+ http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
6
+ {{- end }}
7
+ {{- end }}
8
+ {{- else if contains "NodePort" .Values.service.type }}
9
+ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "magento2-helm.fullname" . }})
10
+ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11
+ echo http://$NODE_IP:$NODE_PORT
12
+ {{- else if contains "LoadBalancer" .Values.service.type }}
13
+ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14
+ You can watch the status of by running 'kubectl get svc -w {{ include "magento2-helm.fullname" . }}'
15
+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "magento2-helm.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
16
+ echo http://$SERVICE_IP:{{ .Values.service.port }}
17
+ {{- else if contains "ClusterIP" .Values.service.type }}
18
+ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "magento2-helm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19
+ echo "Visit http://127.0.0.1:8080 to use your application"
20
+ kubectl port-forward $POD_NAME 8080:80
21
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ { {/* vim: set filetype= mustache: */} }
2
+ { {/*
3
+ Expand the name of the chart.
4
+ */} }
5
+ { {- define " magento2-helm.name" -} }
6
+ { {- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix " -" -} }
7
+ { {- end -} }
8
+
9
+ { {/*
10
+ Create a default fully qualified app name.
11
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12
+ If release name contains chart name it will be used as a full name.
13
+ */} }
14
+ { {- define " magento2-helm.fullname" -} }
15
+ { {- if .Values.fullnameOverride -} }
16
+ { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" -} }
17
+ { {- else -} }
18
+ { {- $name := default .Chart.Name .Values.nameOverride -} }
19
+ { {- if contains $name .Release.Name -} }
20
+ { {- .Release.Name | trunc 63 | trimSuffix " -" -} }
21
+ { {- else -} }
22
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
23
+ { {- end -} }
24
+ { {- end -} }
25
+ { {- end -} }
26
+
27
+ { {/*
28
+ Create chart name and version as used by the chart label.
29
+ */} }
30
+ { {- define " magento2-helm.chart" -} }
31
+ { {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
32
+ { {- end -} }
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : {{ include "magento2-helm.fullname" . }}
5
+ labels :
6
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
7
+ helm.sh/chart : {{ include "magento2-helm.chart" . }}
8
+ app.kubernetes.io/instance : {{ .Release.Name }}
9
+ app.kubernetes.io/managed-by : {{ .Release.Service }}
10
+ spec :
11
+ replicas : {{ .Values.replicaCount }}
12
+ selector :
13
+ matchLabels :
14
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
15
+ app.kubernetes.io/instance : {{ .Release.Name }}
16
+ template :
17
+ metadata :
18
+ labels :
19
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
20
+ app.kubernetes.io/instance : {{ .Release.Name }}
21
+ spec :
22
+ containers :
23
+ - name : {{ .Chart.Name }}
24
+ image : " {{ .Values.image.repository }}:{{ .Values.image.tag }}"
25
+ imagePullPolicy : {{ .Values.image.pullPolicy }}
26
+ ports :
27
+ - name : http
28
+ containerPort : 80
29
+ protocol : TCP
30
+ livenessProbe :
31
+ httpGet :
32
+ path : /
33
+ port : http
34
+ readinessProbe :
35
+ httpGet :
36
+ path : /
37
+ port : http
38
+ resources :
39
+ {{- toYaml .Values.resources | nindent 12 }}
40
+ {{- with .Values.nodeSelector }}
41
+ nodeSelector :
42
+ {{- toYaml . | nindent 8 }}
43
+ {{- end }}
44
+ {{- with .Values.affinity }}
45
+ affinity :
46
+ {{- toYaml . | nindent 8 }}
47
+ {{- end }}
48
+ {{- with .Values.tolerations }}
49
+ tolerations :
50
+ {{- toYaml . | nindent 8 }}
51
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ {{- if .Values.ingress.enabled -}}
2
+ {{- $fullName := include "magento2-helm.fullname" . -}}
3
+ {{- $ingressPaths := .Values.ingress.paths -}}
4
+ apiVersion : extensions/v1beta1
5
+ kind : Ingress
6
+ metadata :
7
+ name : {{ $fullName }}
8
+ labels :
9
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
10
+ helm.sh/chart : {{ include "magento2-helm.chart" . }}
11
+ app.kubernetes.io/instance : {{ .Release.Name }}
12
+ app.kubernetes.io/managed-by : {{ .Release.Service }}
13
+ {{- with .Values.ingress.annotations }}
14
+ annotations :
15
+ {{- toYaml . | nindent 4 }}
16
+ {{- end }}
17
+ spec :
18
+ {{- if .Values.ingress.tls }}
19
+ tls :
20
+ {{- range .Values.ingress.tls }}
21
+ - hosts :
22
+ {{- range .hosts }}
23
+ - {{ . | quote }}
24
+ {{- end }}
25
+ secretName : {{ .secretName }}
26
+ {{- end }}
27
+ {{- end }}
28
+ rules :
29
+ {{- range .Values.ingress.hosts }}
30
+ - host : {{ . | quote }}
31
+ http :
32
+ paths :
33
+ {{- range $ingressPaths }}
34
+ - path : {{ . }}
35
+ backend :
36
+ serviceName : {{ $fullName }}
37
+ servicePort : http
38
+ {{- end }}
39
+ {{- end }}
40
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Service
3
+ metadata :
4
+ name : {{ include "magento2-helm.fullname" . }}
5
+ labels :
6
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
7
+ helm.sh/chart : {{ include "magento2-helm.chart" . }}
8
+ app.kubernetes.io/instance : {{ .Release.Name }}
9
+ app.kubernetes.io/managed-by : {{ .Release.Service }}
10
+ spec :
11
+ type : {{ .Values.service.type }}
12
+ ports :
13
+ - port : {{ .Values.service.port }}
14
+ targetPort : http
15
+ protocol : TCP
16
+ name : http
17
+ selector :
18
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
19
+ app.kubernetes.io/instance : {{ .Release.Name }}
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Pod
3
+ metadata :
4
+ name : " {{ include " magento2-helm.fullname" . }}-test-connection"
5
+ labels :
6
+ app.kubernetes.io/name : {{ include "magento2-helm.name" . }}
7
+ helm.sh/chart : {{ include "magento2-helm.chart" . }}
8
+ app.kubernetes.io/instance : {{ .Release.Name }}
9
+ app.kubernetes.io/managed-by : {{ .Release.Service }}
10
+ annotations :
11
+ " helm.sh/hook " : test-success
12
+ spec :
13
+ containers :
14
+ - name : wget
15
+ image : busybox
16
+ command : ['wget']
17
+ args : ['{{ include "magento2-helm.fullname" . }}:{{ .Values.service.port }}']
18
+ restartPolicy : Never
Original file line number Diff line number Diff line change
1
+ # Default values for magento2-helm.
2
+ # This is a YAML-formatted file.
3
+ # Declare variables to be passed into your templates.
4
+
5
+ replicaCount : 1
6
+
7
+ image :
8
+ repository : nginx
9
+ tag : stable
10
+ pullPolicy : IfNotPresent
11
+
12
+ nameOverride : " "
13
+ fullnameOverride : " "
14
+
15
+ service :
16
+ type : ClusterIP
17
+ port : 80
18
+
19
+ ingress :
20
+ enabled : false
21
+ annotations : {}
22
+ # kubernetes.io/ingress.class: nginx
23
+ # kubernetes.io/tls-acme: "true"
24
+ paths : []
25
+ hosts :
26
+ - chart-example.local
27
+ tls : []
28
+ # - secretName: chart-example-tls
29
+ # hosts:
30
+ # - chart-example.local
31
+
32
+ resources : {}
33
+ # We usually recommend not to specify default resources and to leave this as a conscious
34
+ # choice for the user. This also increases chances charts run on environments with little
35
+ # resources, such as Minikube. If you do want to specify resources, uncomment the following
36
+ # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
37
+ # limits:
38
+ # cpu: 100m
39
+ # memory: 128Mi
40
+ # requests:
41
+ # cpu: 100m
42
+ # memory: 128Mi
43
+
44
+ nodeSelector : {}
45
+
46
+ tolerations : []
47
+
48
+ affinity : {}
You can’t perform that action at this time.
0 commit comments