Skip to content

Instantly share code, notes, and snippets.

@alexandrevilain
Created October 18, 2022 08:00
Show Gist options
  • Save alexandrevilain/e3570f09626b7a46c5c0c3ec86aeaff7 to your computer and use it in GitHub Desktop.
Save alexandrevilain/e3570f09626b7a46c5c0c3ec86aeaff7 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
ports:
- port: 80
name: web
selector:
app: nginx
---
apiVersion: v1
kind: Service
metadata:
name: nginx-headless
labels:
app: nginx
spec:
ports:
- port: 80
name: web
clusterIP: None
selector:
app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
serviceName: "nginx"
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: registry.k8s.io/nginx-slim:0.8
livenessProbe:
failureThreshold: 4
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 15
ports:
- containerPort: 80
name: web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment