f4e24f7449
Build and Deploy to Production / build-and-deploy (push) Has been cancelled
- Add cms-config.yaml (K8s Secret) for staging and production
- Mount appsettings.{Environment}.json from Secret into /app/
- Update CI/CD pipelines to apply Secret before Deployment
- Remove redundant env vars (Kestrel, FileStorage) — now in config file
129 lines
2.6 KiB
YAML
129 lines
2.6 KiB
YAML
---
|
|
# CMS Uploads PersistentVolumeClaim
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: cms-uploads-pvc
|
|
namespace: foursat
|
|
labels:
|
|
app: cms
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 20Gi
|
|
|
|
---
|
|
# CMS Microservice Deployment
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: cms
|
|
namespace: foursat
|
|
labels:
|
|
app: cms
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: cms
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: cms
|
|
spec:
|
|
containers:
|
|
- name: cms
|
|
image: 194.5.195.53:30080/admin/cms:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
env:
|
|
- name: ASPNETCORE_ENVIRONMENT
|
|
value: "Staging"
|
|
- name: ASPNETCORE_URLS
|
|
value: "http://+:8080"
|
|
volumeMounts:
|
|
- name: cms-uploads
|
|
mountPath: /app/Uploads
|
|
- name: cms-config
|
|
mountPath: /app/appsettings.Staging.json
|
|
subPath: appsettings.Staging.json
|
|
readOnly: true
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "1000m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health/live
|
|
port: 8080
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health/ready
|
|
port: 8080
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
volumes:
|
|
- name: cms-uploads
|
|
persistentVolumeClaim:
|
|
claimName: cms-uploads-pvc
|
|
- name: cms-config
|
|
secret:
|
|
secretName: cms-appsettings
|
|
|
|
---
|
|
# CMS Service
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: cms-svc
|
|
namespace: foursat
|
|
spec:
|
|
selector:
|
|
app: cms
|
|
ports:
|
|
- name: http
|
|
port: 8080
|
|
targetPort: 8080
|
|
type: ClusterIP
|
|
|
|
---
|
|
# CMS Ingress
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: cms-ingress
|
|
namespace: foursat
|
|
annotations:
|
|
kubernetes.io/ingress.class: "nginx"
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
spec:
|
|
tls:
|
|
- hosts:
|
|
- cms.se.kbs1.ir
|
|
secretName: cms-tls
|
|
rules:
|
|
- host: cms.se.kbs1.ir
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: cms-svc
|
|
port:
|
|
number: 8080
|