Skip to content

Instantly share code, notes, and snippets.

@miluna
Last active December 2, 2021 15:05
Show Gist options
  • Save miluna/a964e3710bd046f9013e2a7b0e133b37 to your computer and use it in GitHub Desktop.
Save miluna/a964e3710bd046f9013e2a7b0e133b37 to your computer and use it in GitHub Desktop.
Sample Kubernetes Deployment yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: <ms-name>
labels:
app: <ms-name>
spec:
selector:
matchLabels:
app: <ms-name>
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 1
template:
metadata:
labels:
app: <ms-name>
spec:
imagePullSecrets:
- name: harbor-registry-secret
containers:
- name: <ms-name>
env:
- name: SPRING_PROFILES_ACTIVE
value: SPRINGPROFILE
- name: PSQL_USER
valueFrom:
secretKeyRef:
name: psql-secret
key: spring.datasource.username
- name: PSQL_PASSWORD
valueFrom:
secretKeyRef:
name: psql-secret
key: spring.datasource.password
image: DOCKERIMAGE
imagePullPolicy: "Always"
resources:
requests:
cpu: 100m
memory: 200Mi
limits:
cpu: 1000m
memory: 2048Mi
ports:
- containerPort: 8080
name: <ms-name-port>
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 80
periodSeconds: 3
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 80
periodSeconds: 10
securityContext:
runAsGroup: 9999
runAsUser: 9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment