7 changed files with 106 additions and 27 deletions
@ -0,0 +1,17 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: ConfigMap |
||||
|
metadata: |
||||
|
name: {{ include "covidok.appsettings" . }} |
||||
|
data: |
||||
|
appsettings.k8s.json: | |
||||
|
{ |
||||
|
"ConnectionStrings": { |
||||
|
"MySQLDatabase": "server={{- include "covidok.mysql" . -}};database={{ .Values.config.mysql.database }};user={{ .Values.config.mysql.user }};password={{ .Values.config.mysql.password }}", |
||||
|
"RedisHost": "{{ include "covidok.redis" . }}:{{ .Values.config.redis.port }}" |
||||
|
}, |
||||
|
"MinioSettings": { |
||||
|
"HostName": "{{ include "covidok.minio" . }}", |
||||
|
"AccessKey": "{{ .Values.config.minio.accesskey }}", |
||||
|
"SecretKey": "{{ .Values.config.minio.secretkey }}" |
||||
|
} |
||||
|
} |
@ -1,42 +1,50 @@ |
|||||
# TODO: Add helm templating |
|
||||
apiVersion: v1 |
apiVersion: v1 |
||||
kind: Service |
kind: Service |
||||
metadata: |
metadata: |
||||
name: mysql |
name: {{ include "covidok.mysql" . }} |
||||
|
labels: |
||||
|
{{- include "covidok.labels" . | nindent 4 }} |
||||
spec: |
spec: |
||||
ports: |
ports: |
||||
- port: 3306 |
- port: 3306 |
||||
selector: |
selector: |
||||
|
{{- include "covidok.selectorLabels" . | nindent 4 }} |
||||
app: mysql |
app: mysql |
||||
--- |
--- |
||||
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 |
apiVersion: apps/v1 |
||||
kind: Deployment |
kind: Deployment |
||||
metadata: |
metadata: |
||||
name: mysql |
name: {{ include "covidok.mysql" . }} |
||||
spec: |
spec: |
||||
selector: |
selector: |
||||
matchLabels: |
matchLabels: |
||||
|
{{- include "covidok.selectorLabels" . | nindent 6 }} |
||||
app: mysql |
app: mysql |
||||
strategy: |
strategy: |
||||
type: Recreate |
type: Recreate |
||||
template: |
template: |
||||
metadata: |
metadata: |
||||
|
{{- with .Values.podAnnotations }} |
||||
|
annotations: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
labels: |
labels: |
||||
|
{{- include "covidok.selectorLabels" . | nindent 8 }} |
||||
app: mysql |
app: mysql |
||||
spec: |
spec: |
||||
containers: |
containers: |
||||
- image: mysql:8.0 |
- image: "{{ .Values.images.mysql.name }}:{{ .Values.images.mysql.tag }}" |
||||
name: mysql |
name: mysql |
||||
env: |
env: |
||||
# Use secret in real usage |
# Use secret in real usage |
||||
- name: MYSQL_ROOT_PASSWORD |
- name: MYSQL_ROOT_PASSWORD |
||||
value: dev-pass1 |
value: dev-pass1 |
||||
- name: MYSQL_DATABASE |
- name: MYSQL_DATABASE |
||||
value: "covidok" |
value: "{{ .Values.config.mysql.database }}" |
||||
- name: MYSQL_USER |
- name: MYSQL_USER |
||||
value: "covidok" |
value: "{{ .Values.config.mysql.user }}" |
||||
- name: MYSQL_PASSWORD |
- name: MYSQL_PASSWORD |
||||
value: "covidok" |
value: "{{ .Values.config.mysql.password }}" |
||||
ports: |
ports: |
||||
- containerPort: 3306 |
- containerPort: 3306 |
||||
name: mysql |
name: mysql |
||||
|
Loading…
Reference in new issue