K8s YAML - woveon/wovtools GitHub Wiki

< Home

Woveon Logo

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.

Deployment File : MYMICROSERVICE.yaml.wov

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}}