Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active June 4, 2021 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/0d700a1393386f15448d26803a8f8cd9 to your computer and use it in GitHub Desktop.
Save garystafford/0d700a1393386f15448d26803a8f8cd9 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: service-h
labels:
app: service-h
component: service
spec:
ports:
- name: http
port: 8080
selector:
app: service-h
component: service
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: service-h
labels:
app: service-h
component: service
version: v1
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 1
selector:
matchLabels:
app: service-h
component: service
version: v1
template:
metadata:
labels:
app: service-h
component: service
version: v1
spec:
containers:
- name: service-h
image: registry.hub.docker.com/garystafford/go-srv-h:1.6.8
livenessProbe:
httpGet:
path: /api/health
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
env:
- name: LOG_LEVEL
value: info
- name: MONGO_CONN
valueFrom:
secretKeyRef:
name: go-srv-config
key: mongodb.conn
- name: GREETING
value: "Nǐ hǎo (你好), from Service H!"
ports:
- containerPort: 8080
imagePullPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment