Skip to content

Instantly share code, notes, and snippets.

@yogeek
Last active April 18, 2024 13:37
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 yogeek/996dcbcdad88f6404188b6dc5a5fc399 to your computer and use it in GitHub Desktop.
Save yogeek/996dcbcdad88f6404188b6dc5a5fc399 to your computer and use it in GitHub Desktop.
K8s useful resources
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
# nodeName: toto
containers:
- name: nginx
image: yogeek/pinginx
resources:
requests:
memory: "32Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- name: http
port: 8080
protocol : TCP
targetPort: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: pause-deployment
spec:
replicas: 1
selector:
matchLabels:
app: pause-app
template:
metadata:
labels:
app: pause-app
spec:
containers:
- name: pause-container
image: k8s.gcr.io/pause:3.4.1
resources:
limits:
memory: 20Mi
requests:
cpu: '10m'
memory: 10Mi
nodeSelector:
node_group: <NODE_GROUP>
tolerations:
- effect: NoSchedule
key: node_group
operator: Equal
value: <NODE_GROUP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment