Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/magento/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: magento
version: 0.4.16
version: 0.5.0
appVersion: 2.2.0
description: A feature-rich flexible e-commerce solution. It includes transaction options, multi-store functionality, loyalty programs, product categorization and shopper filtering, promotion rules, and more.
keywords:
Expand Down
20 changes: 10 additions & 10 deletions stable/magento/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if empty (include "host" .) -}}
{{- if empty (include "magento.host" .) -}}
###############################################################################
### ERROR: You did not provide an external host in your 'helm install' call ###
###############################################################################
Expand All @@ -10,18 +10,18 @@ host. To configure Magento with the URL of your service:

{{- if contains "NodePort" .Values.serviceType }}

export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}")
export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "magento.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}")
export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")

{{- else if contains "LoadBalancer" .Values.serviceType }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}'
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "magento.fullname" . }}'

export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.magento-password}" | base64 --decode)
export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "magento.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "magento.fullname" . }} -o jsonpath="{.data.magento-password}" | base64 --decode)
{{- if .Values.mariadb.mariadbRootPassword }}
export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "magento.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
{{- end }}
{{- end }}

Expand All @@ -35,17 +35,17 @@ host. To configure Magento with the URL of your service:

{{- if eq .Values.serviceType "ClusterIP" }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "magento.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- else }}

echo Store URL : http://{{ include "host" . }}/
echo Admin URL : http://{{ include "host" . }}/{{ .Values.magentoAdminUri }}
echo Store URL : http://{{ include "magento.host" . }}/
echo Admin URL : http://{{ include "magento.host" . }}/{{ .Values.magentoAdminUri }}
{{- end }}

2. Get your Magento login credentials by running:

echo Username: {{ .Values.magentoUsername }}
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.magento-password}" | base64 --decode)
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "magento.fullname" . }} -o jsonpath="{.data.magento-password}" | base64 --decode)
{{- end }}
18 changes: 9 additions & 9 deletions stable/magento/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "magento.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).
*/}}
{{- define "fullname" -}}
{{- define "magento.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Expand All @@ -19,31 +19,31 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Create a random alphanumeric password string.
We append a random number to the string to avoid password validation errors
*/}}
{{- define "randomPassword" -}}
{{- define "magento.randomPassword" -}}
{{- randAlphaNum 9 -}}{{- randNumeric 1 -}}
{{- end -}}

{{/*
Get the user defined password or use a random string
*/}}
{{- define "password" -}}
{{- define "magento.password" -}}
{{- $password := index .Values (printf "%sPassword" .Chart.Name) -}}
{{- default (include "randomPassword" .) $password -}}
{{- default (include "magento.randomPassword" .) $password -}}
{{- 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).
*/}}
{{- define "mariadb.fullname" -}}
{{- define "magento.mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Get the user defined LoadBalancerIP for this release.
Note, returns 127.0.0.1 if using ClusterIP.
*/}}
{{- define "serviceIP" -}}
{{- define "magento.serviceIP" -}}
{{- if eq .Values.serviceType "ClusterIP" -}}
127.0.0.1
{{- else -}}
Expand All @@ -55,7 +55,7 @@ Note, returns 127.0.0.1 if using ClusterIP.
Gets the host to be used for this application.
If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty.
*/}}
{{- define "host" -}}
{{- define "magento.host" -}}
{{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}}
{{- default (include "serviceIP" .) $host -}}
{{- default (include "magento.serviceIP" .) $host -}}
{{- end -}}
4 changes: 2 additions & 2 deletions stable/magento/templates/apache-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-apache
name: {{ template "magento.fullname" . }}-apache
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand Down
26 changes: 13 additions & 13 deletions stable/magento/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{{- if include "host" . -}}
{{- if include "magento.host" . -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
name: {{ template "magento.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
- name: {{ template "magento.fullname" . }}
image: "{{ .Values.image }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
- name: MARIADB_HOST
value: {{ template "mariadb.fullname" . }}
value: {{ template "magento.mariadb.fullname" . }}
- name: MARIADB_PORT_NUMBER
value: "3306"
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mariadb.fullname" . }}
name: {{ template "magento.mariadb.fullname" . }}
key: mariadb-root-password
- name: MAGENTO_HOST
value: {{ include "host" . | quote }}
value: {{ include "magento.host" . | quote }}
- name: MAGENTO_USERNAME
value: {{ default "" .Values.magentoUsername | quote }}
- name: MAGENTO_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "magento.fullname" . }}
key: magento-password
- name: MAGENTO_EMAIL
value: {{ default "" .Values.magentoEmail | quote }}
Expand All @@ -58,7 +58,7 @@ spec:
port: http
httpHeaders:
- name: Host
value: {{ include "host" . | quote }}
value: {{ include "magento.host" . | quote }}
initialDelaySeconds: 420
timeoutSeconds: 5
failureThreshold: 6
Expand All @@ -68,7 +68,7 @@ spec:
port: http
httpHeaders:
- name: Host
value: {{ include "host" . | quote }}
value: {{ include "magento.host" . | quote }}
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 5
Expand All @@ -83,14 +83,14 @@ spec:
- name: magento-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-magento
claimName: {{ template "magento.fullname" . }}-magento
{{- else }}
emptyDir: {}
{{- end }}
- name: apache-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-apache
claimName: {{ template "magento.fullname" . }}-apache
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions stable/magento/templates/magento-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-magento
name: {{ template "magento.fullname" . }}-magento
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand Down
6 changes: 3 additions & 3 deletions stable/magento/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
name: {{ template "magento.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
magento-password: "{{ b64enc (include "password" .) }}"
magento-password: "{{ b64enc (include "magento.password" .) }}"
6 changes: 3 additions & 3 deletions stable/magento/templates/svc.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "magento.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand All @@ -20,4 +20,4 @@ spec:
port: 443
targetPort: https
selector:
app: {{ template "fullname" . }}
app: {{ template "magento.fullname" . }}