[stable/magento] Add service.type to values.yaml (#9401)

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>
This commit is contained in:
Javier J. Salmerón-García
2018-11-20 09:21:12 -08:00
committed by k8s-ci-robot
parent 4ce0133527
commit fe317ffa3d
6 changed files with 41 additions and 23 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: magento
version: 3.3.0
version: 4.0.0
appVersion: 2.2.6
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:
+11 -10
View File
@@ -10,12 +10,12 @@ host. To configure Magento with the URL of your service:
1. Get the Magento URL by running:
{{- if contains "NodePort" .Values.serviceType }}
{{- if contains "NodePort" .Values.service.type }}
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 }}
{{- else if contains "LoadBalancer" .Values.service.type }}
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 "magento.fullname" . }}'
@@ -39,22 +39,23 @@ host. To configure Magento with the URL of your service:
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
helm upgrade {{ .Release.Name }} stable/magento \
--set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }}
--set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }}
{{- end }}
{{- else -}}
1. Get the Magento URL by running:
{{- if eq .Values.serviceType "ClusterIP" }}
{{- if eq .Values.service.type "ClusterIP" }}
echo "Store URL: http://127.0.0.1:8080/"
echo "Admin URL: http://127.0.0.1:8080/{{ .Values.magentoAdminUri }}"
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "magento.fullname" . }} 8080:80
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "magento.fullname" . }} 8080:{{ .Values.service.port }}
{{- else }}
echo Store URL : http://{{ include "magento.host" . }}/
echo Admin URL : http://{{ include "magento.host" . }}/{{ .Values.magentoAdminUri }}
{{- $port:=.Values.service.port | toString }}
echo Store URL : http://{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/
echo Admin URL : http://{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/{{ .Values.magentoAdminUri }}
{{- end }}
@@ -76,9 +77,9 @@ host. To configure Magento to use and external database host:
1. Complete your Magento deployment by running:
{{- if contains "NodePort" .Values.serviceType }}
{{- if contains "NodePort" .Values.service.type }}
export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
{{- else if contains "LoadBalancer" .Values.serviceType }}
{{- else if contains "LoadBalancer" .Values.service.type }}
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 "magento.fullname" . }}'
@@ -93,5 +94,5 @@ host. To configure Magento to use and external database host:
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
helm upgrade {{ .Release.Name }} stable/magento \
--set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,serviceType={{ .Values.serviceType }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST
--set magentoPassword=$APP_PASSWORD,magentoHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST
{{- end }}
+1 -1
View File
@@ -44,7 +44,7 @@ Get the user defined LoadBalancerIP for this release.
Note, returns 127.0.0.1 if using ClusterIP.
*/}}
{{- define "magento.serviceIP" -}}
{{- if eq .Values.serviceType "ClusterIP" -}}
{{- if eq .Values.service.type "ClusterIP" -}}
127.0.0.1
{{- else -}}
{{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}}
+2 -1
View File
@@ -78,8 +78,9 @@ spec:
name: {{ template "magento.fullname" . }}-externaldb
key: db-password
{{- end }}
{{- $port:=.Values.service.port | toString }}
- name: MAGENTO_HOST
value: {{ include "magento.host" . | quote }}
value: "{{ include "magento.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}"
- name: MAGENTO_USERNAME
value: {{ .Values.magentoUsername | quote }}
- name: MAGENTO_PASSWORD
+9 -9
View File
@@ -8,16 +8,16 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.serviceType }}
{{- if eq .Values.serviceType "LoadBalancer" }}
loadBalancerIP: {{ default "" .Values.magentoLoadBalancerIP }}
type: {{ .Values.service.type }}
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
- name: http
port: {{ .Values.service.port }}
targetPort: http
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}}
nodePort: {{ .Values.service.nodePorts.http }}
{{- end }}
selector:
app: {{ template "magento.fullname" . }}
+17 -1
View File
@@ -140,7 +140,23 @@ mariadb:
## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
##
serviceType: LoadBalancer
service:
type: LoadBalancer
# HTTP Port
port: 80
# HTTPS Port
httpsPort: 443
##
## nodePorts:
## http: <to set explicitly, choose port between 30000-32767>
## https: <to set explicitly, choose port between 30000-32767>
nodePorts:
http: ""
https: ""
## Enable client source IP preservation
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Cluster
## Configure liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)