feat: aeris helm chart

This commit is contained in:
GitBluub
2022-03-06 16:10:18 +01:00
parent 759cce7d51
commit 5bb437231d
14 changed files with 251 additions and 84 deletions
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: configmap-back
data:
WORKER_API_URL: http://api:8080/worker
WORKER_URL: http://worker:5000
BACK_URL: https://aeris.westeurope.cloudapp.azure.com/api/
+36 -1
View File
@@ -1 +1,36 @@
version
apiVersion: apps/v1
kind: Deployment
metadata:
name: aeris-back
spec:
replicas: 3
selector:
matchLabels:
app: back
template:
metadata:
labels:
app: back
spec:
containers:
- name: back
imagePullPolicy: Always
image: {{ .Values.BACK_IMAGE }}
ports:
- containerPort: 8080
volumeMounts:
- mountPath: "/cache"
name: postgres-volume-claim
envFrom:
- configMapRef:
name: configmap-postgres
- configMapRef:
name: configmap-back
- secretRef:
name: secret-postgres
- secretRef:
name: secret-back
volumes:
- name: postgres-volume-claim
persistentVolumeClaim:
claimName: volume-claim-back
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: api-service
spec:
type: LoadBalancer
# loadBalancerIP: "20.105.195.175"
selector:
app: back
ports:
- port: 8080
targetPort: 8080
+26
View File
@@ -0,0 +1,26 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: volume-back
labels:
type: local
name: volume-back
spec:
storageClassName: manual
capacity:
storage: 50M
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: volume-claim-back
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50M
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: api
spec:
type: ClusterIP
# loadBalancerIP: "20.105.195.175"
selector:
app: back
ports:
- port: 8080
targetPort: 8080
@@ -0,0 +1,18 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: louis.auzuret@gmail.com
privateKeySecretRef:
name: letsencrypt
solvers:
- http01:
ingress:
class: nginx
podTemplate:
spec:
nodeSelector:
"kubernetes.io/os": linux
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: aeris-front
spec:
replicas: 3
selector:
matchLabels:
app: front
template:
metadata:
labels:
app: front
spec:
containers:
- name: front
imagePullPolicy: Always
image: {{ .Values.FRONT_IMAGE }}
#args: ["/api"]
ports:
- containerPort: 80
@@ -0,0 +1,52 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: aeris-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- aeris.westeurope.cloudapp.azure.com
secretName: tls-secret
rules:
- host: aeris.westeurope.cloudapp.azure.com
http:
paths:
- path: /(.*)
pathType: Prefix
backend:
service:
name: front-cluster
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: aeris-ingress-static
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /static/$2
nginx.ingress.kubernetes.io/use-regex: "true"
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- aeris.westeurope.cloudapp.azure.com
secretName: tls-secret
rules:
- host: aeris.westeurope.cloudapp.azure.com
http:
paths:
- path:
pathType: Prefix
backend:
service:
name: front-cluster
port:
number: 80
path: /static(/|$)(.*)
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: front-service
spec:
type: LoadBalancer
#loadBalancerIP: "13.81.34.213"
selector:
app: front
ports:
- port: 80
targetPort: 80
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: front-cluster
spec:
type: ClusterIP
#loadBalancerIP: "13.81.34.213"
selector:
app: front
ports:
- port: 80
targetPort: 80
@@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: postgres
image: postgres:12
image: {{ .Values.DB_IMAGE }}
ports:
- containerPort: 5432
hostPort: 5432
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: aeris-worker
spec:
replicas: 3
selector:
matchLabels:
app: worker
template:
metadata:
labels:
app: worker
spec:
restartPolicy: Always
containers:
- name: worker
imagePullPolicy: Always
image: {{ .Values.WORKER_IMAGE }}
ports:
- containerPort: 5000
envFrom:
- secretRef:
name: secret-back
- configMapRef:
name: configmap-back
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: worker
spec:
type: ClusterIP
selector:
app: worker
ports:
- port: 5000
targetPort: 5000
+4 -82
View File
@@ -1,82 +1,4 @@
# Default values for aeris.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}
BACK_IMAGE: aeris.azurecr.io/back
FRONT_IMAGE: aeris.azurecr.io/front
WORKER_IMAGE: aeris.azurecr.io/worker
DB_IMAGE: aeris.azurecr.io/postgres