Skip to content

Instantly share code, notes, and snippets.

@CarlosLanderas
Last active December 13, 2018 23:14
Show Gist options
  • Save CarlosLanderas/4f651fdaa2342db55f66d41f405630c6 to your computer and use it in GitHub Desktop.
Save CarlosLanderas/4f651fdaa2342db55f66d41f405630c6 to your computer and use it in GitHub Desktop.
Kubernetes deployment and infrastructure for Healthchecks tutorial
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webapp-deploy
spec:
replicas: 3
template:
metadata:
labels:
app: webapp-deploy
spec:
containers:
- name: webapp
image: webapp
imagePullPolicy: Never
livenessProbe:
httpGet:
path: /self
port: 80
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 15
readinessProbe:
httpGet:
path: /ready
port: 80
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 15
---
kind: Service
apiVersion: v1
metadata:
name: webapp-service
spec:
selector:
app: webapp-deploy
type: NodePort
ports:
-
port: 80
targetPort: 80
nodePort: 30000
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: sqlserver
spec:
template:
metadata:
labels:
app: sqlserver
spec:
containers:
- name: sqlserver
image: microsoft/mssql-server-linux
env:
- name : ACCEPT_EULA
value: "Y"
- name : SA_PASSWORD
value: "SuperPass2018"
---
kind: Service
apiVersion: v1
metadata:
name: sqlserver
spec:
selector:
app: sqlserver
type: ClusterIP
ports:
-
port: 1433
targetPort: 1433
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis
---
kind: Service
apiVersion: v1
metadata:
name: redis
spec:
selector:
app: redis
type: ClusterIP
ports:
-
port: 6379
targetPort: 6379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment