mirror of
https://github.com/LeNei/fullstack-helm-chart.git
synced 2026-02-13 22:56:19 +00:00
First commit
This commit is contained in:
48
templates/api-deployment.yaml
Normal file
48
templates/api-deployment.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.api.appName }} # Name of the deployment
|
||||
labels:
|
||||
app: {{ .Values.api.appName }} # Name of your application
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.api.appName }} # Name of your application
|
||||
replicas: {{ .Values.api.replicas }} # Number of replicas
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.api.appName }} # Name of your application
|
||||
spec:
|
||||
containers:
|
||||
# Containers are the individual pieces of your application that you want
|
||||
# to run.
|
||||
- name: {{ .Values.api.appName }} # Name of the container
|
||||
image: {{ .Values.api.image }}
|
||||
ports:
|
||||
# Ports are the ports that your application uses.
|
||||
- containerPort: {{ .Values.api.containerPort }} # The port that your application uses
|
||||
env:
|
||||
- name: APP_ENVIRONMENT
|
||||
value: "production"
|
||||
- name: APP_APPLICATION__PORT
|
||||
value: "{{ .Values.api.containerPort }}"
|
||||
- name: APP_DATABASE__HOST
|
||||
value: "{{ .Release.Name }}-postgresql"
|
||||
- name: APP_DATABASE__USERNAME
|
||||
value: "postgres"
|
||||
- name: APP_DATABASE__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-postgresql"
|
||||
key: postgres-password
|
||||
- name: APP_DATABASE__DATABASE_NAME
|
||||
value: "{{ .Values.postgresql.auth.database }}"
|
||||
- name: APP_DATABASE__REQUIRE_SSL
|
||||
value: "false"
|
||||
- name: APP_AUTH__JWKS_URL
|
||||
value: "{{ .Values.api.jwksUrl }}"
|
||||
- name: CARGO_MANIFEST_DIR
|
||||
value: "/app"
|
||||
imagePullSecrets:
|
||||
- name: docker-regcred
|
||||
23
templates/api-ingress.yaml
Normal file
23
templates/api-ingress.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
kind: Ingress
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ .Values.api.appName }}
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
||||
traefik.ingress.kubernetes.io/router.middlewares: "{{ .Release.Namespace }}-redirect-https@kubernetescrd"
|
||||
spec:
|
||||
rules:
|
||||
- host: {{ .Values.api.host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Values.api.appName }}
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .Values.api.host }}
|
||||
secretName: {{ .Values.api.host | replace "." "-" }}
|
||||
11
templates/api-service.yaml
Normal file
11
templates/api-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.api.appName }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.api.appName }}
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
15
templates/cluster-issuer.yaml
Normal file
15
templates/cluster-issuer.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt
|
||||
spec:
|
||||
acme:
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
email: {{ .Values.email }}
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt
|
||||
solvers:
|
||||
- selector: {}
|
||||
http01:
|
||||
ingress:
|
||||
class: traefik
|
||||
26
templates/frontend-deployment.yaml
Normal file
26
templates/frontend-deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.nextjs.appName }} # Name of the deployment
|
||||
labels:
|
||||
app: {{ .Values.nextjs.appName }} # Name of your application
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.nextjs.appName }} # Name of your application
|
||||
replicas: {{ .Values.nextjs.replicas }} # Number of replicas
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.nextjs.appName }} # Name of your application
|
||||
spec:
|
||||
containers:
|
||||
# Containers are the individual pieces of your application that you want
|
||||
# to run.
|
||||
- name: {{ .Values.nextjs.appName }} # Name of the container
|
||||
image: {{ .Values.nextjs.image }}
|
||||
ports:
|
||||
# Ports are the ports that your application uses.
|
||||
- containerPort: {{ .Values.nextjs.containerPort }} # The port that your application uses
|
||||
imagePullSecrets:
|
||||
- name: docker-regcred
|
||||
23
templates/frontend-ingres.yaml
Normal file
23
templates/frontend-ingres.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
kind: Ingress
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ .Values.nextjs.appName }}
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
||||
traefik.ingress.kubernetes.io/router.middlewares: "{{ .Release.Namespace }}-redirect-https@kubernetescrd"
|
||||
spec:
|
||||
rules:
|
||||
- host: {{ .Values.nextjs.host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Values.nextjs.appName }}
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .Values.nextjs.host }}
|
||||
secretName: {{ .Values.nextjs.host | replace "." "-" }}
|
||||
11
templates/frontend-service.yaml
Normal file
11
templates/frontend-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.frontend.appName }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.frontend.appName }}
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
8
templates/traefik-middleware.yaml
Normal file
8
templates/traefik-middleware.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: redirect-https
|
||||
spec:
|
||||
redirectScheme:
|
||||
scheme: https
|
||||
permanent: true
|
||||
Reference in New Issue
Block a user