-
Notifications
You must be signed in to change notification settings - Fork 0
K8s YAML
Chad Wingrave edited this page Dec 26, 2019
·
2 revisions
< Home
Each microservice you have will have K8s files to tell Kubernetes how to manage it. WovTools assumes you have a general ingress file and one service and deployment file per microservice.
This file tells Kubernetes how to deploy. Notices the Handlebars syntax to insert variables.
# Deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{MS}}
spec:
template:
metadata:
labels:
app: {{MS}}
spec:
containers:
- image: {{ARCHIVEREPOSITORY}}/{{PROJECT}}/{{MS}}:{{STAGE}}_{{PVER}}
name: {{MS}}
imagePullPolicy: Always
ports:
- containerPort: 80
name: http
protocol: TCP
envFrom:
- secretRef:
name: {{MS}}
- configMapRef:
name: {{MS}}
livenessProbe:
httpGet:
path: \{{{{MS}}.healthpath}}
port: 80
initialDelaySeconds: 3
periodSeconds: \{{{{MS}}.healthprobetime}}