Table of Contents
Imperative way to run commands with kubectl.
- List pods showing their labels
kubectl get pod --show-labels- List pods with specific label
kubectl get pod -owide --selector=$label- Remove default taint from master nodes
kubectl taint nodes --all node-role.kubernetes.io/master-- Add taint to a node
kubectl taint nodes node1 key1=value1:NoScheduleDeclarative way to create, modify objects or anything in k8s.
- Create pod with taint toleration
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
tolerations:
- key: "example-key"
operator: "Equals"
value: "example-value"
effect: "NoSchedule"
- Create deployment with NodeAffinity
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: nginx
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
containers:
- image: nginx
name: nginx
resources: {}
status: {}
Please contribute using the templates below.
- Showing files
Please ...First line
...Second line
paste the file content here
- One line commands
this is an example command- Step-by-steps
- Get a free API Key at https://example.com
- Clone the repo
git clone https://github.com/your_username_/Project-Name.git
- Install NPM packages
npm install
- Enter your API in
config.jsconst API_KEY = 'ENTER YOUR API';