This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountHelm/templates/api.yml

107 lines
2.5 KiB
YAML
Raw Normal View History

2019-11-26 18:17:21 +00:00
apiVersion: v1
kind: ConfigMap
metadata:
name: env-api
namespace: {{ .Release.Namespace }}
data:
APP_DEBUG: "true"
DB_CONNECTION: "mysql"
DB_HOST: "{{.Values.mysql.host}}"
DB_PORT: "{{.Values.mysql.port}}"
DB_DATABASE: "{{.Values.mysql.database}}"
DB_USERNAME: "{{.Values.mysql.username}}"
DB_PASSWORD: "{{.Values.mysql.password}}"
SAVE_TOKEN_TO_SESSION: "false"
NEW_GUI: "1"
2019-11-27 16:13:24 +00:00
GUI_URL: "{{.Values.api.frontendURL}}"
2019-11-26 18:17:21 +00:00
S3_ACCESS_KEY: "{{.Values.s3.accessKey}}"
S3_SECRET: "{{.Values.s3.secret}}"
S3_Bucket: "{{.Values.s3.bucket}}"
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: api
namespace: {{ .Release.Namespace }}
spec:
replicas: {{.Values.api.replicas}}
template:
metadata:
labels:
app: api
spec:
initContainers:
- name: init-migration
imagePullPolicy: {{.Values.api.imagePullPolicy}}
2019-11-27 16:13:24 +00:00
image: {{.Values.api.container}}:{{.Values.api.version}}
2019-11-26 18:17:21 +00:00
command: ['php', 'artisan', 'migrate', '--force']
envFrom:
- configMapRef:
name: env-api
containers:
- name: api
imagePullPolicy: {{.Values.api.imagePullPolicy}}
2019-11-27 16:13:24 +00:00
image: {{.Values.api.container}}:{{.Values.api.version}}
2019-11-26 18:17:21 +00:00
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: env-api
{{ if .Values.dockerHub.enabled }}
imagePullSecrets:
- name: {{.Values.dockerHub.secret}}
{{ end }}
---
apiVersion: v1
kind: Service
metadata:
annotations:
field.cattle.io/targetWorkloadIds: '["deployment:{{ .Release.Namespace }}:api"]'
name: ingress-api
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
type: ClusterIP
status:
loadBalancer: {}
{{ if .Values.api.ssl }}
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: api-tls
namespace: {{ .Release.Namespace }}
spec:
secretName: api-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
2019-11-27 16:13:24 +00:00
commonName: '{{ .Values.api.url }}'
2019-11-26 18:17:21 +00:00
dnsNames:
2019-11-27 16:13:24 +00:00
- {{ .Values.api.url }}
2019-11-26 18:17:21 +00:00
{{ end }}
2019-11-27 16:13:24 +00:00
{{ if .Values.api.ingress }}
2019-11-26 18:17:21 +00:00
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api
namespace: {{ .Release.Namespace }}
spec:
rules:
2019-11-27 16:13:24 +00:00
- host: {{ .Values.api.url }}
2019-11-26 18:17:21 +00:00
http:
paths:
- backend:
serviceName: ingress-api
servicePort: 80
path: /
{{ if .Values.api.ssl }}
tls:
2019-11-27 16:13:24 +00:00
- secretName: api-tls
{{ end }}
2019-11-26 18:17:21 +00:00
{{ end }}