49 lines
1 KiB
YAML
49 lines
1 KiB
YAML
{{ if .Values.mysql.ownServer }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: env-mysql-server
|
|
namespace: {{ .Release.Namespace }}
|
|
data:
|
|
MYSQL_ROOT_PASSWORD: "{{ randAlphaNum 40 }}"
|
|
MYSQL_DATABASE: "{{.Values.mysql.database}}"
|
|
MYSQL_USER: "{{.Values.mysql.username}}"
|
|
MYSQL_PASSWORD: "{{.Values.mysql.password}}"
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mysql
|
|
namespace: {{ .Release.Namespace }}
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mysql
|
|
spec:
|
|
containers:
|
|
- name: mysql
|
|
image: mysql:5.6
|
|
ports:
|
|
- containerPort: 3306
|
|
envFrom:
|
|
- configMapRef:
|
|
name: env-mysql-server
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
annotations:
|
|
field.cattle.io/targetWorkloadIds: '["deployment:{{ .Release.Namespace }}:mysql"]'
|
|
name: mysql
|
|
namespace: {{ .Release.Namespace }}
|
|
spec:
|
|
ports:
|
|
- port: 3306
|
|
protocol: TCP
|
|
targetPort: 3306
|
|
type: ClusterIP
|
|
status:
|
|
loadBalancer: {}
|
|
{{ end }}
|