mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/opencart] Allow use of external database (#4186)
* [stable/opencart] Allow use of external database * Add mariabdRootPassword property * Fix typo * Update image tag * Delete trailing space
This commit is contained in:
committed by
k8s-ci-robot
parent
a03f11b36c
commit
05e56341bf
@@ -1,5 +1,5 @@
|
||||
name: opencart
|
||||
version: 0.6.3
|
||||
version: 0.7.0
|
||||
appVersion: 3.0.2
|
||||
description: A free and open source e-commerce platform for online merchants. It provides
|
||||
a professional and reliable foundation for a successful online store.
|
||||
|
||||
@@ -59,6 +59,16 @@ The following tables lists the configurable parameters of the OpenCart chart and
|
||||
| `smtpUser` | SMTP user | `nil` |
|
||||
| `smtpPassword` | SMTP password | `nil` |
|
||||
| `smtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` |
|
||||
| `allowEmptyPassword` | Allow DB blank passwords | `yes` |
|
||||
| `externalDatabase.host` | Host of the external database | `nil` |
|
||||
| `externalDatabase.port` | Port of the external database | `3306` |
|
||||
| `externalDatabase.user` | Existing username in the external db | `bn_opencart` |
|
||||
| `externalDatabase.password` | Password for the above username | `nil` |
|
||||
| `externalDatabase.database` | Name of the existing databse | `bitnami_opencart` |
|
||||
| `mariadb.enabled` | Wheter to use or not the mariadb chart | `true` |
|
||||
| `mariadb.mariadbDatabase` | Database name to create | `bitnami_opencart` |
|
||||
| `mariadb.mariadbUser` | Database user to create | `bn_opencart` |
|
||||
| `mariadb.mariadbPassword` | Password for the database | `nil` |
|
||||
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` |
|
||||
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
|
||||
| `persistence.enabled` | Enable persistence using PVC | `true` |
|
||||
|
||||
@@ -2,5 +2,5 @@ dependencies:
|
||||
- name: mariadb
|
||||
repository: https://kubernetes-charts.storage.googleapis.com/
|
||||
version: 0.7.0
|
||||
digest: sha256:e1af13ac4ac21f67582006f12d2b4eb78a1a2a59b34338fac850f2bec0b08b41
|
||||
generated: 2017-08-09T22:52:53.617765447-04:00
|
||||
digest: sha256:f59f68030aa5c50b9e776b813804875fac911f91c2aa384e991f37a795c5ae34
|
||||
generated: 2018-03-15T15:14:56.908345+01:00
|
||||
|
||||
@@ -2,3 +2,4 @@ dependencies:
|
||||
- name: mariadb
|
||||
version: 0.7.0
|
||||
repository: https://kubernetes-charts.storage.googleapis.com/
|
||||
condition: mariadb.enabled
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}}
|
||||
|
||||
{{- if empty (include "opencart.host" .) -}}
|
||||
###############################################################################
|
||||
### ERROR: You did not provide an external host in your 'helm install' call ###
|
||||
@@ -27,8 +29,17 @@ host. To configure OpenCart with the URL of your service:
|
||||
|
||||
2. Complete your OpenCart deployment by running:
|
||||
|
||||
helm upgrade {{ .Release.Name }} \
|
||||
--set opencartHost=$APP_HOST,opencartPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} stable/opencart
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
|
||||
helm upgrade {{ .Release.Name }} stable/opencart \
|
||||
--set opencartHost=$APP_HOST,opencartPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbPassword }},mariadb.mariadbPassword=$APP_DATABASE_PASSWORD{{ end }}
|
||||
{{- else }}
|
||||
|
||||
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
|
||||
|
||||
helm upgrade {{ .Release.Name }} stable/opencart \
|
||||
--set opencartPassword=$APP_PASSWORD,opencartHost=$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 }}
|
||||
{{- end }}
|
||||
|
||||
{{- else -}}
|
||||
1. Get the OpenCart URL by running:
|
||||
@@ -48,3 +59,34 @@ host. To configure OpenCart with the URL of your service:
|
||||
echo Admin Username: {{ .Values.opencartUsername }}
|
||||
echo Admin Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "opencart.fullname" . }} -o jsonpath="{.data.opencart-password}" | base64 --decode)
|
||||
{{- end }}
|
||||
|
||||
{{- else -}}
|
||||
|
||||
########################################################################################
|
||||
### ERROR: You did not provide an external database host in your 'helm install' call ###
|
||||
########################################################################################
|
||||
|
||||
This deployment will be incomplete until you configure OpenCart with a resolvable database
|
||||
host. To configure OpenCart to use and external database host:
|
||||
|
||||
1. Complete your OpenCart deployment by running:
|
||||
|
||||
{{- if contains "NodePort" .Values.serviceType }}
|
||||
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 "opencart.fullname" . }}'
|
||||
|
||||
export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "opencart.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
|
||||
{{- else }}
|
||||
|
||||
export APP_HOST=127.0.0.1
|
||||
{{- end }}
|
||||
export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "opencart.fullname" . }} -o jsonpath="{.data.opencart-password}" | base64 --decode)
|
||||
|
||||
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
|
||||
|
||||
helm upgrade {{ .Release.Name }} stable/opencart \
|
||||
--set opencartPassword=$APP_PASSWORD,opencartHost=$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
|
||||
{{- end }}
|
||||
@@ -19,15 +19,37 @@ spec:
|
||||
image: "{{ .Values.image }}"
|
||||
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
|
||||
env:
|
||||
- name: ALLOW_EMPTY_PASSWORD
|
||||
value: {{ .Values.allowEmptyPassword | quote }}
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
- name: MARIADB_HOST
|
||||
value: {{ template "opencart.mariadb.fullname" . }}
|
||||
- name: MARIADB_PORT_NUMBER
|
||||
value: "3306"
|
||||
- name: MARIADB_PASSWORD
|
||||
- name: OPENCART_DATABASE_NAME
|
||||
value: {{ .Values.mariadb.mariadbDatabase | quote }}
|
||||
- name: OPENCART_DATABASE_USER
|
||||
value: {{ .Values.mariadb.mariadbUser | quote }}
|
||||
- name: OPENCART_DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "opencart.mariadb.fullname" . }}
|
||||
key: mariadb-root-password
|
||||
key: mariadb-password
|
||||
{{- else }}
|
||||
- name: MARIADB_HOST
|
||||
value: {{ .Values.externalDatabase.host | quote }}
|
||||
- name: MARIADB_PORT_NUMBER
|
||||
value: {{ .Values.externalDatabase.port | quote }}
|
||||
- name: OPENCART_DATABASE_NAME
|
||||
value: {{ .Values.externalDatabase.database | quote }}
|
||||
- name: OPENCART_DATABASE_USER
|
||||
value: {{ .Values.externalDatabase.user | quote }}
|
||||
- name: OPENCART_DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
key: db-password
|
||||
{{- end }}
|
||||
- name: OPENCART_HOST
|
||||
value: {{ include "opencart.host" . | quote }}
|
||||
- name: OPENCART_USERNAME
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if not .Values.mariadb.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
labels:
|
||||
app: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
type: Opaque
|
||||
data:
|
||||
db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }}
|
||||
{{- end }}
|
||||
@@ -1,7 +1,7 @@
|
||||
## Bitnami OpenCart image version
|
||||
## ref: https://hub.docker.com/r/bitnami/opencart/tags/
|
||||
##
|
||||
image: bitnami/opencart:3.0.2-0-r3
|
||||
image: bitnami/opencart:3.0.2-0-r4
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
@@ -35,6 +35,29 @@ opencartUsername: user
|
||||
##
|
||||
opencartEmail: user@example.com
|
||||
|
||||
## Set to `yes` to allow the container to be started with blank passwords
|
||||
## ref: https://github.com/bitnami/bitnami-docker-opencart#environment-variables
|
||||
allowEmptyPassword: "yes"
|
||||
|
||||
##
|
||||
## External database configuration
|
||||
##
|
||||
externalDatabase:
|
||||
## Database host
|
||||
host:
|
||||
|
||||
## Database host
|
||||
port: 3306
|
||||
|
||||
## Database user
|
||||
user: bn_opencart
|
||||
|
||||
## Database password
|
||||
password:
|
||||
|
||||
## Database name
|
||||
database: bitnami_opencart
|
||||
|
||||
## SMTP mail delivery configuration
|
||||
## ref: https://github.com/bitnami/bitnami-docker-opencart/#smtp-configuration
|
||||
##
|
||||
@@ -48,6 +71,24 @@ opencartEmail: user@example.com
|
||||
## MariaDB chart configuration
|
||||
##
|
||||
mariadb:
|
||||
## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters
|
||||
enabled: true
|
||||
|
||||
## Create a database
|
||||
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-on-first-run
|
||||
##
|
||||
mariadbDatabase: bitnami_opencart
|
||||
|
||||
## Create a database user
|
||||
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
|
||||
##
|
||||
mariadbUser: bn_opencart
|
||||
|
||||
## Password for mariadbUser
|
||||
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
|
||||
##
|
||||
# mariadbPassword:
|
||||
|
||||
## MariaDB admin password
|
||||
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user