gcloud-lab/trading-platform/deploy/k8s/base/data-service-deployment.yaml

72 lines
1.8 KiB
YAML
Raw Normal View History

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: data-service
namespace: customer1
labels:
app: data-service
app.kubernetes.io/name: data-service
app.kubernetes.io/component: microservice
spec:
replicas: 2
selector:
matchLabels:
app: data-service
template:
metadata:
labels:
app: data-service
app.kubernetes.io/name: data-service
app.kubernetes.io/component: microservice
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 1000
containers:
- name: data-service
image: "trading-platform/data-service:v${VERSION}"
ports:
- containerPort: 8001
protocol: TCP
envFrom:
- configMapRef:
name: trading-platform-config
resources:
limits:
cpu: "1000m"
memory: 1Gi
requests:
cpu: "500m"
memory: 512Mi
livenessProbe:
httpGet:
path: /health
port: 8001
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8001
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}