update
This commit is contained in:
94
script/k8s/deployment.yaml
Normal file
94
script/k8s/deployment.yaml
Normal file
@@ -0,0 +1,94 @@
|
||||
# Kubernetes Deployment Configuration
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: blog
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
replicas: ${KUBERNETES_DEPLOYMENT_REPLICAS}
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
app: blog
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
|
||||
containers:
|
||||
- name: blog
|
||||
image: ${CONTAINER_REGISTRY_URL}/${CONTAINER_REGISTRY_NAMESPACE}/${CONTAINER_IMAGE_NAME}:${CONTAINER_IMAGE_TAG}
|
||||
imagePullPolicy: Always
|
||||
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8888
|
||||
protocol: TCP
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/blog/ping
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/blog/ping
|
||||
port: http
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "1000m"
|
||||
|
||||
env:
|
||||
- name: TZ
|
||||
value: "UTC"
|
||||
- name: DATABASE_DSN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-secrets
|
||||
key: database-dsn
|
||||
- name: JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-secrets
|
||||
key: jwt-secret
|
||||
- name: JWT_ISSUER
|
||||
value: "${JWT_ISSUER}"
|
||||
- name: JWT_EXPIRES_IN
|
||||
value: "${JWT_EXPIRES_IN}"
|
||||
- name: S3_REGION
|
||||
value: "${S3_REGION}"
|
||||
- name: S3_BUCKET
|
||||
value: "${S3_BUCKET}"
|
||||
- name: S3_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-secrets
|
||||
key: s3-access-key-id
|
||||
- name: S3_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: blog-secrets
|
||||
key: s3-secret-access-key
|
||||
- name: S3_ENDPOINT
|
||||
value: "${S3_ENDPOINT}"
|
||||
- name: S3_PRESIGNED_URL_EXPIRATION
|
||||
value: "${S3_PRESIGNED_URL_EXPIRATION}"
|
||||
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: blog
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
|
||||
labels:
|
||||
app: blog
|
||||
|
||||
spec:
|
||||
rules:
|
||||
- host: ${KUBERNETES_INGRESS_HOST}
|
||||
http:
|
||||
paths:
|
||||
- path: /api/blog
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: blog
|
||||
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: blog
|
||||
namespace: ${KUBERNETES_NAMESPACE}
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
type: ClusterIP
|
||||
|
||||
selector:
|
||||
app: blog
|
||||
|
||||
ports:
|
||||
- name: http
|
||||
port: 8888
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user