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
2019-11-26 19:17:21 +01:00

104 lines
2.5 KiB
YAML

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"
GUI_URL: "{{.Values.guiURL}}"
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}}
image: docker.keks.cloud/keksaccount/web:{{.Values.api.version}}
command: ['php', 'artisan', 'migrate', '--force']
envFrom:
- configMapRef:
name: env-api
containers:
- name: api
imagePullPolicy: {{.Values.api.imagePullPolicy}}
image: docker.keks.cloud/keksaccount/web:{{.Values.api.version}}
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
commonName: '{{ .Values.apiUrl }}'
dnsNames:
- {{ .Values.apiUrl }}
{{ end }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api
namespace: {{ .Release.Namespace }}
spec:
rules:
- host: {{ .Values.apiUrl }}
http:
paths:
- backend:
serviceName: ingress-api
servicePort: 80
path: /
{{ if .Values.api.ssl }}
tls:
- secretName: account-keks-cloud-tls
{{ end }}