Add CI/CD workflows and Kubernetes configurations for deployment
Some checks failed
CI - Build and Push / Build and Push Docker Image (push) Failing after 11s
Some checks failed
CI - Build and Push / Build and Push Docker Image (push) Failing after 11s
This commit is contained in:
64
script/k8s/deployment.yaml
Normal file
64
script/k8s/deployment.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
# Kubernetes Deployment Configuration
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ${CONTAINER_IMAGE_NAME}
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
labels:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
spec:
|
||||
replicas: ${KUBERNETES_DEPLOYMENT_REPLICAS}
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
|
||||
containers:
|
||||
- name: ${CONTAINER_IMAGE_NAME}
|
||||
image: ${FULL_IMAGE_NAME}
|
||||
imagePullPolicy: Always
|
||||
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8888
|
||||
protocol: TCP
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/authenticator/ping
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/authenticator/ping
|
||||
port: http
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
|
||||
env:
|
||||
- name: TZ
|
||||
value: "UTC"
|
||||
- name: DATABASE_DSN
|
||||
value: "${DATABASE_DSN}"
|
||||
25
script/k8s/ingress.yaml
Normal file
25
script/k8s/ingress.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Kubernetes Ingress Configuration for Traefik
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: ${CONTAINER_IMAGE_NAME}
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
|
||||
labels:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
|
||||
spec:
|
||||
rules:
|
||||
- host: ${KUBERNETES_INGRESS_HOST}
|
||||
http:
|
||||
paths:
|
||||
- path: /api/authenticator
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ${CONTAINER_IMAGE_NAME}
|
||||
port:
|
||||
number: 8888
|
||||
7
script/k8s/namespace.yaml
Normal file
7
script/k8s/namespace.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
# Kubernetes Namespace Configuration
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: ${KUBERNETES_NAMESPACE}
|
||||
labels:
|
||||
name: ${KUBERNETES_NAMESPACE}
|
||||
19
script/k8s/service.yaml
Normal file
19
script/k8s/service.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
# Kubernetes Service Configuration
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ${CONTAINER_IMAGE_NAME}
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
labels:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
|
||||
selector:
|
||||
app: ${CONTAINER_IMAGE_NAME}
|
||||
|
||||
ports:
|
||||
- name: http
|
||||
port: 8888
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user