Skip to content

znkovacs/cka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Logo

KB for CKA exam

Table of Contents
  1. Imperative
  2. Declarative
  3. Templates
  4. Acknowledgements



Imperative

Imperative way to run commands with kubectl.

Pods

  • List pods showing their labels
kubectl get pod --show-labels
  • List pods with specific label
kubectl get pod -owide --selector=$label

Nodes

  • 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:NoSchedule


Declarative

Declarative way to create, modify objects or anything in k8s.

Creating Pods

  • 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: {}

Controllers and Services

Templates

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
  1. Get a free API Key at https://example.com
  2. Clone the repo
    git clone https://github.com/your_username_/Project-Name.git
  3. Install NPM packages
    npm install
  4. Enter your API in config.js
    const API_KEY = 'ENTER YOUR API';

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors