Skip to content

Instantly share code, notes, and snippets.

@oioiben
Created June 7, 2019 08:12
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 oioiben/48ea4407fa0443f34ac1b3bffc73f348 to your computer and use it in GitHub Desktop.
Save oioiben/48ea4407fa0443f34ac1b3bffc73f348 to your computer and use it in GitHub Desktop.
K8s resource types
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: go-test-app-deployment
spec:
selector:
matchLabels:
app: go-test-app
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: go-test-app
spec:
containers:
- name: go-test-app
image: go-test-app
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9090
livenessProbe:
httpGet:
path: /
port: 9090
initialDelaySeconds: 15
timeoutSeconds: 1
---
apiVersion: v1
kind: Service
metadata:
name: go-test-app
spec:
selector:
app: go-test-app
type: ClusterIP
ports:
- name: http
port: 9090
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment