My Kubernetes CKA Exam Experience & Concepts Explained

$ whereis etcdctl
$ ETCDCTL_API=3 etcdctl --endpoints=x.x.x.x \
--cacert=/path/to/certs \
--cert=/path/to/certs \
--key=/path/to/key \
--data-dir=/path/to/data/ \
snapshot restore /path/to/snapshot
$ vim /etc/kubernetes/manifests/etcd.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /testpath
pathType: Prefix
backend:
service:
name: test
port:
number: 80
$ kubectl expose pod -n namespacename --name=of-service --type=NodePort --port=80
$ kubectl edit deployment deployment-name -n namespace
spec:
containers:
- name: my-nginx
image: nginx
ports:
- containerPort: 80
name: of-port-you-want
$ kubectl expose deployment name-of-deployment -n namespace --name=of-service --port=80  --type=NodePort --protocol=TCP
$ kubectl create -h
$ kubectl run -h
--dry-run=client -o yaml > name_of.yaml
dry run and output to yaml$ export do="--dry-run=client -o yaml"and when deleting resources resources$ export now="--force --grace-period 0"
$ kubectl run name-of-pod -n namespace --image=nginx --dry-run=client -o yaml > pod.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: name-of-pod
name: name-of-pod
namespace: name-of-namespace
spec:
containers:
- image: nginx
name: container1 #change
- image: busybox #add
name: container2 #add
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store