{"id":18930452,"url":"https://github.com/techprimers/k8s-the-easy-way","last_synced_at":"2025-08-17T07:03:34.230Z","repository":{"id":85853650,"uuid":"194196758","full_name":"TechPrimers/k8s-the-easy-way","owner":"TechPrimers","description":"Tips and Tricks on Kubernetes","archived":false,"fork":false,"pushed_at":"2019-07-17T13:43:39.000Z","size":103,"stargazers_count":18,"open_issues_count":0,"forks_count":54,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T17:16:22.098Z","etag":null,"topics":["ckad","ckad-exercises","kubernetes"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechPrimers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-28T03:00:58.000Z","updated_at":"2024-04-02T17:19:05.000Z","dependencies_parsed_at":"2023-03-13T07:00:12.696Z","dependency_job_id":null,"html_url":"https://github.com/TechPrimers/k8s-the-easy-way","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TechPrimers/k8s-the-easy-way","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechPrimers%2Fk8s-the-easy-way","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechPrimers%2Fk8s-the-easy-way/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechPrimers%2Fk8s-the-easy-way/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechPrimers%2Fk8s-the-easy-way/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechPrimers","download_url":"https://codeload.github.com/TechPrimers/k8s-the-easy-way/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechPrimers%2Fk8s-the-easy-way/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270816298,"owners_count":24650770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ckad","ckad-exercises","kubernetes"],"created_at":"2024-11-08T11:37:41.734Z","updated_at":"2025-08-17T07:03:34.202Z","avatar_url":"https://github.com/TechPrimers.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# K8s - CKAD - The Easy Way\nTips and Tricks on Kubernetes\n\nTable of Contents\n=================\n\n   * [K8s - CKAD - The Easy Way](#k8s---ckad---the-easy-way)\n   * [Table of Contents](#table-of-contents)\n      * [Short Names for Resources](#short-names-for-resources)\n      * [Which apiVersion should I use?](#which-apiversion-should-i-use)\n         * [What does each apiVersion mean?](#what-does-each-apiversion-mean)\n            * [alpha](#alpha)\n            * [beta](#beta)\n            * [stable](#stable)\n            * [v1](#v1)\n            * [apps/v1](#appsv1)\n            * [autoscaling/v1](#autoscalingv1)\n            * [batch/v1](#batchv1)\n            * [batch/v1beta1](#batchv1beta1)\n            * [certificates.k8s.io/v1beta1](#certificatesk8siov1beta1)\n            * [extensions/v1beta1](#extensionsv1beta1)\n            * [policy/v1beta1](#policyv1beta1)\n            * [rbac.authorization.k8s.io/v1](#rbacauthorizationk8siov1)\n      * [Commands](#commands)\n         * [Get list of contexts](#get-list-of-contexts)\n         * [Switch clusters](#switch-clusters)\n         * [Set Namespace for all commands](#set-namespace-for-all-commands)\n         * [Get resources](#get-resources)\n      * [Understanding YAML](#understanding-yaml)\n         * [Selectors](#selectors)\n            * [Equality Based Selectors (Replication Controller) [Old way]](#equality-based-selectors-replication-controller-old-way)\n            * [Set Based Selectors (ReplicatSet) [New way]](#set-based-selectors-replicatset-new-way)\n            * [MatchLabels](#matchlabels)\n      * [Tricks](#tricks)\n         * [AutoCompletion in BASH](#autocompletion-in-bash)\n         * [Set Aliases](#set-aliases)\n      * [References](#references)\n\nCreated by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)\n\n## Short Names for Resources\nShort name\t| Full name\n-----       | -----\ncsr      \t  | certificatesigningrequests\ncs\t        | componentstatuses\ncm\t        | configmaps\nds\t        | daemonsets\ndeploy\t    | deployments\nep\t        | endpoints\nev\t        | events\nhpa      \t  | horizontalpodautoscalers\ning\t        | ingresses\nlimits\t    | limitranges\nns\t        | namespaces\nno\t        | nodes\npvc\t        | persistentvolumeclaims\npv\t        | persistentvolumes\npo\t        | pods\npdb\t        | poddisruptionbudgets\npsp\t        | podsecuritypolicies\nrs\t        | replicasets\nrc\t        | replicationcontrollers\nquota\t      | resourcequotas\nsa\t        | serviceaccounts\nsvc\t        | services\n\n## Which apiVersion should I use?\nKind\t                          | apiVersion\n----                            | ----\nCertificateSigningRequest\t      | certificates.k8s.io/v1beta1\nClusterRoleBinding\t            | rbac.authorization.k8s.io/v1\nClusterRole\t                    | rbac.authorization.k8s.io/v1\nComponentStatus\t                | v1\nConfigMap\t                      | v1\nControllerRevision\t            | apps/v1\nCronJob\t                        | batch/v1beta1\nDaemonSet\t                      | extensions/v1beta1\nDeployment\t                    | extensions/v1beta1\nEndpoints\t                      | v1\nEvent\t                          | v1\nHorizontalPodAutoscaler\t        | autoscaling/v1\nIngress\t                        | extensions/v1beta1\nJob\t                            | batch/v1\nLimitRange\t                    | v1\nNamespace\t                      | v1\nNetworkPolicy\t                  | extensions/v1beta1\nNode\t                          | v1\nPersistentVolumeClaim\t          | v1\nPersistentVolume\t              | v1\nPodDisruptionBudget\t            | policy/v1beta1\nPod\t                            | v1\nPodSecurityPolicy\t              | extensions/v1beta1\nPodTemplate\t                    | v1\nReplicaSet\t                    | extensions/v1beta1\nReplicationController\t          | v1\nResourceQuota\t                  | v1\nRoleBinding\t                    | rbac.authorization.k8s.io/v1\nRole\t                          | rbac.authorization.k8s.io/v1\nSecret\t                        | v1\nServiceAccount\t                | v1\nService\t                        | v1\nStatefulSet\t                    | apps/v1\n\n### What does each apiVersion mean?\n#### alpha\nAPI versions with ‘alpha’ in their name are early candidates for new functionality coming into Kubernetes. These may contain bugs and are not guaranteed to work in the future.\n\n#### beta\n‘beta’ in the API version name means that testing has progressed past alpha level, and that the feature will eventually be included in Kubernetes. Although the way it works might change, and the way objects are defined may change completely, the feature itself is highly likely to make it into Kubernetes in some form.\n\n#### stable\nThese do not contain ‘alpha’ or ‘beta’ in their name. They are safe to use.\n\n#### v1\nThis was the first stable release of the Kubernetes API. It contains many core objects.\n\n#### apps/v1\napps is the most common API group in Kubernetes, with many core objects being drawn from it and v1. It includes functionality related to running applications on Kubernetes, like Deployments, RollingUpdates, and ReplicaSets.\n\n#### autoscaling/v1\nThis API version allows pods to be autoscaled based on different resource usage metrics. This stable version includes support for only CPU scaling, but future alpha and beta versions will allow you to scale based on memory usage and custom metrics.\n\n#### batch/v1\nThe batch API group contains objects related to batch processing and job-like tasks (rather than application-like tasks like running a webserver indefinitely). This apiVersion is the first stable release of these API objects.\n\n#### batch/v1beta1\nA beta release of new functionality for batch objects in Kubernetes, notably including CronJobs that let you run Jobs at a specific time or periodicity.\n\n#### certificates.k8s.io/v1beta1\nThis API release adds functionality to validate network certificates for secure communication in your cluster. You can read more on the official docs.\n\n#### extensions/v1beta1\nThis version of the API includes many new, commonly used features of Kubernetes. Deployments, DaemonSets, ReplicaSets, and Ingresses all received significant changes in this release.\n\nNote that in Kubernetes 1.6, some of these objects were relocated from extensions to specific API groups (e.g. apps). When these objects move out of beta, expect them to be in a specific API group like apps/v1. Using extensions/v1beta1 is becoming deprecated—try to use the specific API group where possible, depending on your Kubernetes cluster version.\n\n#### policy/v1beta1\nThis apiVersion adds the ability to set a pod disruption budget and new rules around pod security.\n\n#### rbac.authorization.k8s.io/v1\nThis apiVersion includes extra functionality for Kubernetes role-based access control. This helps you to secure your cluster. Check out the official blog post.\n\n## Commands\n### Get list of contexts\n`kubectl config get-contexts                          # display list of contexts`\n\n### Switch clusters\n`kubectl config use-context \u003ccluster_name\u003e`\n\n### Set Namespace for all commands\n```\n# permanently save the namespace for all subsequent kubectl commands in that context.\nkubectl config set-context --current --namespace=\u003cnamespace_name\u003e`\n```\n\n### Get resources\n`kubectl -n \u003cnamespace\u003e get \u003cresource_name\u003e`\n\n### Login to pod\n```\n\u003e kubectl exec \u003cpod_name\u003e --stdin --tty -c \u003ccontainer_name\u003e /bin/sh\nEg:\n\u003e kubectl exec nginx-59577d796b-2fsv5 --stdin --tty -c nginx /bin/sh\n# ps -ef | grep nginx\nroot         1     0  0 17:39 ?        00:00:00 nginx: master process nginx -g daemon off;\nnginx        6     1  0 17:39 ?        00:00:00 nginx: worker process\nroot        15     7  0 17:55 pts/0    00:00:00 grep nginx\n# \n```\n\n### Access Pod - PortForward\n- Used for testing purpose in exposing a port in Pod.\n- For Production, use services.\n- 443 is the port running in the Container\n`kubectl port-forward \u003cpod_name\u003e 10443:443`\n\n\n### Create Secret \u0026 ConfigMap\n```\nkubectl create secret generic tls-certs --from-file=\u003cfolder_name\u003e\nkubectl create configmap nginx-proxy-config --from-file=\u003cfolder_name\u003e/proxy.conf\n```\n\n### Create Volume Mounts\n```\n...\nspec:\n  template:\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:1.10\n        ports:\n        - containerPort: 80\n        volumeMounts:\n        - name: \"nginx-proxy-conf\"\n          mountPath: \"/etc/nginx/conf.d\"\n        - name: \"tls-certs\"\n          mountPath: \"/etc/tls\"\n```\n\n### Create Lifecyle\n#### PreStop\n```\n...\nspec:\n  template:\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:1.10\n        ports:\n        - containerPort: 80\n        lifecycle:\n          preStop: \n            exec:\n              command: [\"/usr/sbin/nginx/\", \"-s\", \"quit\"]\n        volumeMounts:\n        - name: \"nginx-proxy-conf\"\n          mountPath: \"/etc/nginx/conf.d\"\n        - name: \"tls-certs\"\n          mountPath: \"/etc/tls\"\n```\n\n### Cluster info\n```\n\u003e kubectl cluster-info\nKubernetes master is running at https://192.168.64.6:8443\nKubeDNS is running at https://192.168.64.6:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n\nTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.\n```\n\n## Understanding YAML\n### Selectors\n#### Equality Based Selectors (Replication Controller) [Old way]\n- Works on `=`, `==`, and `!=`\n- Easy to understand but less powerful\nCommand: `kubectl get pods -l environment=production`\n```\n...\nselector:\n  environment: production\n  tier: frontend\n```\n\n#### Set Based Selectors (ReplicatSet) [New way]\n- Works on `in`, `notin` and `exists`\n- Complex to understand but very powerful\nCommand: `kubectl get pods -l 'environment in (production)'\n```\n...\nselector:\n  matchExpressions:\n    - {key: environment, operator: In, values: [prod, qa]}\n    - {key: tier, operator: NotIn, values: [frontend, backend]}\n```\n\n#### MatchLabels\n- `ReplicationControllers` and `Services` doesnt support `matchLabels` under selectors [Old resources]\n- `Deployments`, `ReplicaSet`, `Jobs` and `DaemonSet` supports `matchLabels` under selectors [New resources]\n\n### Health Checks\n#### Readiness Probe\nReadiness probe is used to identify if the container is ready to accept traffic. In simple terms, it denotes if the Application is completely UP and ready for serving requests.\n```\n...\nreadinessProbe:\n  httpGet:\n    path: /readiness\n    port: 81\n    scheme: HTTP\n    initialDelaySeconds: 5\n    timeoutSeconds: 1\n```\n\n#### Liveness Probe\nIf the liveness probe fails, the Pod will be restarted. This denotes that the health of the container is not good.\n```\n...\nspec:\n  containers:\n  - image: 'gcr.io/\u003cproject_name\u003e/spring-boot-example:v1'\n    name: spring-boot-example\n    livenessProbe:\n      httpGet:\n        path: /actuator/keepalive\n        port: 8080\n      initialDelaySeconds: 15\n ```\n\n## Tricks\n### AutoCompletion in BASH\n```\n# setup autocomplete in bash into the current shell, bash-completion package should be installed first.\nsource \u003c(kubectl completion bash) \n# add autocomplete permanently to your bash shell`.\necho \"source \u003c(kubectl completion bash)\" \u003e\u003e ~/.bashrc \n```\n\n### Set Aliases \n```\nalias k=kubectl\nk get pod\n```\n\n## References\n- [kubectl cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)\n\n\n## Scratch Pad\n```\n\nk run nginx1 --image=nginx --restart=Never -l app=v1\nk run nginx2 --image=nginx --restart=Never -l app=v1\nk run nginx3 --image=nginx --restart=Never -l app=v1\nk get po\nk get po -o wide\nk get po --labels\nk get po --show-labels\nk get po --label-columns\nk get po --label-column\nk get po --label-columns=app\nk edit label\nk edit -h\nk edit po nginx2\nk get po --show-labels\nk label po -h\nhistory\nk label po nginx2 app=v2 --override\nk label po nginx2 app=v2 --overwrite\nk get po --label-columns=app\nk get po -L app\nk get po -L app=v2\nk get po -h\nk get po -l app=v2\nk get po -l 'app in (v1, v2)'\nk get po -l 'app in (v2)'\nc\nk label po -h\nk label pods app-\nk label pods app- --all\nk get po\nk get po --show-labels\nkubectl label po -lapp app-\nkubectl label po nginx{1..3} app-\nkubectl label po nginx1 nginx2 nginx3 app-\nc\nk run -h\nk run -h | grep label\nk get no -h\nk get no -h | grep label\nk get no --show-labels\nk run nginx --image=nginx --restart=Never --field-selector accelerator=nvidia-tesla-p100\nk explain po.spec | grep node\nk run nginx --image=nginx --restart=Never --dry-run -o yaml \u003e pod-selector.yml\nvi pod-selector.yml\nk create -f pod-selector.yml\nk get po -w\nk annotate -h\nk annotate pods nginx1 nginx2 nginx3 description='mydescription'\nk describe pods nginx1\nk describe po nginx1 | grep -i 'annotations'\nk describe po nginx1 -o jsonpath='{.metadata.Annotations}'\nk describe po nginx1 -o jsonpath='{.metadata.annotations}'\nk annotate -h\nk annotate po nginx1 nginx2 nginx3 description-\nk describe po nginx1 | grep -i 'annotations'\nk delete po nginx nginx1 nginx2 nginx3\nk run nginx --image=nginx:1.7.8 --replicas=2 --port=80 --dry-run -o yaml\nk run nginx --image=nginx:1.7.8 --replicas=2 --port=80 --dry-run -o yaml \u003e deployment.yml\nk create -f deployment.yml\nk get de -w\nk get do -w\nk get deploy -w\nk get all\nkubectl create deployment nginx  --image=nginx:1.7.8  --dry-run -o yaml\nk describe deploy nginx -o yaml\nk get deploy nginx -o yaml\nk get deploy nginx -o yaml --export\nc\nk get rs nginx\nk get all\nk get rs nginx-587746989d -o yaml\nk get rs nginx-587746989d -o yaml  --export\nk get rs -l run=nginx\nk get pods\nk get po nginx-587746989d-4rbmb -o yaml --expor\nk get po nginx-587746989d-4rbmb -o yaml --export\nc\nk rollout deployment nginx\nk rollout status deployment nginx\nk rollout -h\nk set image -h\nk set image deploy nginx nginx=nginx:1.7.9\nk describe deploy nginx\nk rollout history deploy nginx\nk get rs nginx\nk get rs\nk get po\nk get deploy\nk rollout undo deploy nginx\nk get po -w\nk describe deploy nginx\nk set image deploy nginx nginx=nginx:1.91\nk get all\nk get po -w\nk rollout status deploy nginx\nk history deploy nginx\nk rollout history deploy nginx\nk rollout -h\nk rollout deploy -h\nk rollout undo -h\nk rollout undo --to-revision=2\nk rollout undo deploy nginx --to-revision=2\nk get po -w\nk rollout status deploy nginx\nk describe deploy nginx| grep -i 'Image'\nk rollout -h\nk rollout history deploy nginx -h\nk rollout history deploy nginx --revision=3\nk scale deploy nginx -h\nk scale deploy nginx --replicas=5\nk get po -w\nk scale deploy -h\nk autoscale\nk autoscale -h\nc\nhistory\nc\nk autoscale -h\nk autoscale deploy nginx --min=5 --max=10 --cpu-percent=80\nk describe deploy nginx\nk describe rs\nk rollout pause deploy nginx\nk set image deploy nginx nginx=nginx:1.9.1\nk rollout status deploy nginx\nk rollout history deploy nginx\nk rollout resume deploy nginx\nk rollout status deploy nginx\nk get po\nk rollout history deploy nginx\nk rollout history deploy nginx --revision=6\nk get all\nk delete deploy nginx\nk getl all\nk get all\nk delete hps -h\nk get hpa\nk delete hpa nginx\nk get all\nk run perl -h\nk run perl --restart=OnFailure -c \"perl -Mbignum=bpi -wle 'print bpi(2000)'\"\nk run perl --restart=OnFailure --image=perl --command \"perl -Mbignum=bpi -wle 'print bpi(2000)'\" --dry-run -o yaml\nk run perl --restart=OnFailure --image=perl --command \"perl -Mbignum=bpi -wle 'print bpi(2000)'\"\nk get all\nk rollout batch perl\nk rollout -h\nk get all\nk logs perl\nk logs perl-62hgp\nk get all\nk delete job perl\nk get all\nk create job perl --image=perl -- \"perl -Mbignum=bpi -wle 'print bpi(2000)'\"\nk get all\nk get po\nk get po -w\nk delete job perl\nk create job pi --image=perl -- \"perl -Mbignum=bpi -wle 'print bpi(2000)'\"\nk get po -w\nk get all\nk delete job pi\nk create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)'\nk get po -w\nk logs pi-whrqr\nk get all\nk delete job pi\nk get all\nc\nk create job bb --image=busybox -- echo hello;sleep 30;echo world\nk get po -w\nk logs bb-6v4cj\nk logs bb-6v4cj -f\nk get job\nk get all\nk job\nk get job -o wide\nk describe job bb\nk logs job/bb\nk get jobs\nk delete job bb\nk create job -h\nk explain job.spec\nk create job bb image=busybox --dry-run -o yaml\nk create job bb --image=busybox --dry-run -o yaml\nk create job bb --image=busybox --dry-run -o yaml \u003e job.yaml\nk explain job.spec\nvi job.yaml\nk create -f job.yaml\nk get all\nvi job.yaml\nk apply -f job.yaml\nk get all\nk delete job bb\nk create -f job.yaml\nk get all\nk get job\nk create job -h\nk create cronjob -h\nk create job -h\nk run busybox --restart=OnFailure -h\nk run busybox --restart=OnFailure --schedule='*/1 * * * *' --image=busybox -- /bin/sh -c 'date; echo Hello from the Kubernetes cluster'\nk get job\nk get all\nk get cronjob\nk logs cronjob/busybox\nk get cronjob\nk run busybox2 --restart=OnFailure --schedule=\"*/1 * * * *\" --image=busybox -- /bin/sh -c 'date; echo Hello from the Kubernetes cluster'\nk get cronjob\nk logs cronjob/busybox\nk get all\nk logs cronjob/busybox\nk logs cronjob/busybox2\nk logs cronjob/busybox -f\nk get jobs -w\nk logs pod/busybox2-1563334860-5dnl8\nk logs pod/busybox-1563334800-5jts2\nk get po --show-labels\nk delete cj busybox\nk delete cj busybox2\n\nk create configmap config --from-literal=foo=lala --from-literal=foo2=lolo\nk get cm\nk get cm -o wide\nk get all\nk describe cm config\nk get cm config\nk get cm config -o yaml\nk get cm config -o yaml --export\nc\nk create configmap -h\nc\necho -e \"foo3=lili\\nfoo4=lele\" \u003e config.txt\nk create configmap config-file --from-file=./config.txt\nk describe cm config-file\nk get cm config-file -o yaml\nk get cm config-file -o yaml --export\nc\necho -e \"var1=val1\\n# this is a comment\\n\\nvar2=val2\\n#anothercomment\" \u003e config.env\nk create cm -h\nc\nk create cm config-env-file --from-env-file=./config.env\nk get cm config-env-file\nk get cm config-env-file -o yaml\nk get cm config-env-file -o yaml --export\necho -e \"var3=val3\\nvar4=val4\" \u003e config4.txt\nk create cm config4 --from-file ./config4.txt\nk get cm config4 -o yaml --export\nc\nk get cm config4 -o yaml --export\nk get cm config4 -o yaml --export \u003e config-map-key.yml\nvi config\nvi config-map-key.yml\nk explain configmap.spec\nk explain configmap\nk explain configmap.metadata\nk explain configmap --recursive | grep key\nk explain configmap --recursive | grep generator\nk explain configmap --recursive | grep -i generator\nc\nk create cm config5 --from-file=special=./config4.txt -o yaml --dry-run\nk create cm options --from-literal=var5=val5\nk describe cm options\nk run nginx --image=nginx --restart=Never -h\nc\nk run nginx --image=nginx --restart=Never --dry-run -o yaml \u003e config-pod.yml\nvi config\nvi config-pod.yml\nk create -f config-pod.yml\nvi config-pod.yml\nk create -f config-pod.yml\nk describe po nginx\nk exec nginx -- env\nk create configmap env:\nc\nk create configmap anotherone --from-literal=var6=val6 --from-literal=var7=val7\nk run nginx2 --image=nginx --restart=Never --dry-run -o yaml \u003e pod-config2.yml\nvi pod-config2.yml\nk create -f pod-config2.yml\nk describe po nginx2\nk exec nginx2 -- env\nk create cm cmvolume --from-literal var8=val8 var9=val9\nk create cm cmvolume --from-literal var8=val8 --from-literal var9=val9\nk run nginx3 --image=nginx --restart=Never --dry-run -o yaml -- /bin/sh 'ls /etc/lala'\nk run nginx3 --image=nginx --restart=Never --dry-run -o yaml -- /bin/sh 'ls /etc/lala' \u003e nginx3.yml\nvi nginx3.yml\nk create -f nginx3.yml\nk logs nginx3\nk describe nginx3\nk describe po nginx3\nk logs nginx3\nk exec nginx3 -- ls /etc/lala\nvi nginx3.yml\nk delete po nginx3\nk create -f nginx3.yml\nvi nginx3.yml\nk create -f nginx3.yml\nvi nginx3.yml\nk create -f nginx3.yml\nvi nginx3.yml\nk create -f nginx3.yml\nvi nginx3.yml\nc\nk run nginx -h\nk run nginx -h | grep UID\nk run nginx -h | grep -i UID\nk run nginx --restart=Never --image=nginx --dry-run -o yaml\nk run nginx --=h\nk run nginx --restart=Never --requests cpu=100m,memory=256Mi --limits cpu=200m,memory=512Mi --dry-run -o yaml\nk run nginx --restart=Never --requests cpu=100m,memory=256Mi --limits cpu=200m,memory=512Mi --image=nginx --dry-run -o yaml\nk run nginx --restart=Never --requests cpu=100m,memory=256Mi --limits cpu=200m,memory=512Mi --image=nginx\nk run nginx7 --restart=Never --requests cpu=100m,memory=256Mi --limits cpu=200m,memory=512Mi --image=nginx\nk describe nginx7\nk describe po nginx7\nc\nk get all\nk delete po nginx nginx2 nginx7\nc\nk create secret -h\nk create secret generic -j\nk create secret generic --from-literal password=mypass\nk create secret generic --from-literal=password=mypass\nk create secret generic --from-literal password=mypass\nk create secret generic mysecret --from-literal password=mypass\nk get secret\nk describe secret mysecret\necho admin \u003e username\nk create secret generic mysecret2 -h\nk create secret generic mysecret2 --from-file ./username\nk describe secret mysecret2\nk get secret mysecret2\nk get secret mysecret2 -o yaml\nk get secret mysecret2 -o yaml --export\nk get secret mysecret2 -o yaml --export | cut -f :\ncut help\ncut --help\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2 ':'\nk get secret mysecret2 -o yaml --export | grep username| cut ':' -f 2\nk get secret mysecret2 -o yaml --export | grep username| cut  -f 2 -d ':'\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2 -d ':' | cut -d ' '\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2 -d ':' | cut -d ' ' -f 2\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2 -d ':' | cut -d ' ' -f 2\nk get secret mysecret2 -o yaml --export | grep username| cut -f 2 -d ':' | cut -d ' ' -f 2\nkubectl get secret mysecret2 -o jsonpath='{.data.username}{\"\\n\"}'\nvi pod-secret.yml\nk create -f pod-secret.yml\nk exec secret-test-pod -it -- /bin/bash\nk get po\nk delete po secret-test-po\nk delete po secret-test-pod\nvi pod-secret.yml\nk create -f pod-se\nk create -f pod-secret.yml\nk describe po secret-test-pod\nk get po\nk exec secret-text-po -it -- /bin.bash\nk exec secret-text-pod -it -- /bin/bash\nk exec secret-test-pod -it -- /bin/bash\nc\nk get sa --all-namespaces\nk create sa myuser\nk describe sa myuser\nk run nginx --image=nginx --restart=Never --serviceaccount\nk run nginx --image=nginx --restart=Never --serviceaccount=myuser --dry-run -o yaml\nk run nginx --image=nginx --restart=Never --serviceaccount=myuser\nk describe po nginx | grep service\n\nk cp bb:/etc/passwd ./passwd2\nvi passwd\nvi pass\nk exec bb -- /bin/sh -c 'cat /etc/passwd' \u003e passwd\nk exec bb -- /bin/sh -c 'cat /etc/passwd'\nk run bb --image=busybox --restart=Never -- /bin/sh -c 'sleep 3600'\nk delete po busybox busybox1\nk exec busybox1 -it -- /bin/sh\nk create -f pvc-pod.yaml\nvi pvc-pod.yaml\nk exec busybox -it -- /bin/sh\nk describe po busybox\nvi pvc-pod.y\nk run busybox --restart=Never --image=busybox --dry-run -o yaml --command -- /bin/sh -c 'sleep 3600' \u003e pvc-pod.yaml\nk delete po busybox\nvi pvc-pod.yml\nvi pv\nk run busybox --restart=Never --image=busybox -o yaml --command -- /bin/sh -c 'sleep 3600' \u003e pvc-pod.yml\nk run busybox --restart=Never --image=busybox --command -- /bin/sh -c 'sleep 3600' \u003e pvc-pod.yml\nk get pv\nk get pvc\nk describe pvc mypvc\nk create -f pvc.yaml\nvi pvc.yaml\nk describe pv myvolume\nk create -f pv.yaml\nvi pv.yaml\nk delete po bb\nk get po\nk exec bb -c bb1 -it -- /bin/sh -c 'cat /etc/foo/passwd'\nk exec bb -c bb1 -it -- /bin/sh\nk exec bb -c bb2 -it -- /bin/sh\nk create -f bb2.yaml\nvi bb2.yaml\nk run bb --image=busybox --restart=Never --dry-run -o yaml -- /bin/sh -c 'sleep 3600' \u003e bb2.yaml\nvi bb\nk run bb --image=busybox --restart=Never --dry-run -o yaml \u003e bb2.yaml\nk run bb --image=busybox --restart=Never --dry-run -o yaml\nk get all\nk delete po nginx3\nk exec nginx3 -it -- /bin/sh\nk exec nginx3 -- ls /etc/lala\nk exec nginx -- ls /etc/lala\nk describe po nginx3\nk create -f config-pod.yaml\nk delete pod nginx3\nk delete pod nginx2\nk delete pod nginx1\nk delete pod nginx{1..3}\nvi config-pod.yaml\nk run nginx3 --restart=Never --image=nginx --dry-run -o yaml\u003e config-pod.yaml\nk run nginx3 --restart=Never --image=nginx --dry-run -o yaml\nk create cm cmvolume --from-literal var8=val8 --from-literal var9=val9\nk create cm config5 --from-file=special=./config4.txt -o yaml --dry-run\nk get cm config4 -o yaml\nk get cm config4\nk get cm confi4\nk create -f config4.yml\nvi config4.yml\nk create cm config4 --from-file=./config4.txt --dry-run -o yaml \u003e config4.yml\nls\npwd\nk create cm config4 --from-file=./config4.txt --dry-run -o yaml\necho -e \"var3=val3\\nvar4=val4\" \u003e config4.txt\nminikube start\nminikube status\nexport PS1=\"[\\u@\\h \\W]\\$ \" ;clear;\nexit\nminikube stop\nk get po -o wide\nk delete pod nginx\nk run nginx1 --image=nginx --restart=Never --labels=app=v1\nk run nginx3 --image=nginx --restart=Never --labels=app=v1\nk run nginx2 --image=nginx --restart=Never --labels=app=v1\nk run nginx --image=nginx --restart=Never --labels=app=v1\nminikube delete\nk describe po nginx\nk exec nginx -it sh\nk run nginx --image=nginx --restart=Never --env=\"var1=val1\"\nk run bb1 --restart=Never --image=busybox -it --rm --command -- echo 'Hello World'\nk run busybox1 --restart=Never --image=busybox --rm --command -- echo 'Hello World'\nk logs busybox\nk get po busybox -w\nk get po busybox\nk run busybox --restart=Never --image=busybox --command -- echo 'Hello World'\nk delete pod busybox\nk logs pod/nginx -p\nk logs pod/nginx\nk get po nginx -o yaml --export\nk get po nginx -o yaml -h\nk get po nginx -o yaml\nk get po nginx -o jsonpath='{.status.podIP}'\nk get po nginx --jsonpath='.status.PodIP'\nk run bb --image=busybox --restart=Never --rm -it -- /bin/sh\nk get po -w\nkubectl set image pod/nginx nginx=nginx:1.7.1\nk set image po nginx nginx=nginx:1.7.1\nk apply -f try4.yml\nvi try4.yml\nk run nginx --image=nginx --restart=Never --port=80 -o yaml --dry-run \u003e try4.yml\nk describe po nginx -o yaml\nk edit po -h\nk edit po nginx --image=nginx:.7.1\nk run nginx --image=nginx --restart=Never --port=80\nk run nginx --image=nginx --restart=Never --port=80 -o yaml --dry-run\nk delete pod nginx -n mynamespace\nk get po --all-namespaces\nk create quota myrq --dry-run -o yaml --hard=cpu=1,memory=1G,pods=2 \u003e try3.yml\nk create quota myrq --dry-run -o yaml --hard=cpu=1,memory=1G,pods=2\nk create quota myrq --dry-run -o yaml\nk create quota -h\nk create resourcequota\nk create namespace myns --dry-run -o yaml \u003e try3.yml\nk create namespace myns --dry-run -o yaml\nk get pod -w\nk create -f try2.yml\nk run busybox --restart=Never --image=busybox --dry-run -o yaml --command -- env \u003e try2.yml\nk run busybox --restart=Never --image=busybox --dry-run -o yaml --command -- env\nk run busybox --restart=Never --image=busybox --command -- env -o yaml --dry-run\nk run busybox --restart=Never --image=busybox --command='env' -o yaml --dry-run\nk run nginx --restart=Never --image=nginx -o yaml --dry-run \u003e try1.yml\nk run nginx --restart=Never --image=nginx -o yaml --dry-run\nk get all -n mynamespace\nk run nginx --restart=Never --image=nginx -n mynamespace\nk delete deploy nginx -n mynamespace\nk get all -n mynamespace -n mynamespace\nk delete deploy nginx\nk run nginx --image=nginx --namespace=mynamespace\nk create namespace mynamespace\nk delete svc nginx\nvi ingress-np.yml\nk create -f ingress-np.yml\nk create np -h\nk run nginx --image=nginx --port=80 --expose --replicas=2\nk delete deploy foo\nk delete svc foo\nk get ep foo\nk get ep\nk get endpoints\nwget 10.98.203.247:6262/\nk describe svc foo\nwget 10.98.203.247:6262\nwget -O- 192.168.64.9:6262\nwget -O- http://127.0.0.1:6262\nwget -O- http://192.168.64.9:6262\nwget -O-http://192.168.64.9:6262\nwget http://192.168.64.9:6262\nminikube ip\nk get deploy\nk get svc\nwget http://10.98.203.247:6262\nwget http://10.104.71.160:6262\nk expose deployment foo --port=6262 --target-port=8080\nwget http://10.104.71.160:6262/\nk get svc -w\nk expose deployment foo --port=6262\nkubectl run foo --image=dgkanatsios/simpleapp --labels=app=foo --port=8080 --replicas=3\nk version\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechprimers%2Fk8s-the-easy-way","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechprimers%2Fk8s-the-easy-way","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechprimers%2Fk8s-the-easy-way/lists"}