Kubernetes: Container orchestration. Uses the primary/replica model.
Links
Commands
kubectl get nodes-> list all cluster nodeskubectl describe nodes-> gives detailed node infokubectl get namespaces-> describes all namespaces in the clusterkubectl get pods --all-namespaces-> get pods in namespaceskubectl get pods -n [namespace]-> get shit in the given namespacekubectl get deployments --all-namespaces-> list all deployments lolkubectl get statefulset --all-namespaces-> lists all statefulsetskubectl top pods --all-namespaces-> gets the top pods lol. also, can work withnodestookubectl get events --all-namespaces-> gets all eventskubectl get services-> get all serviceskubectl describe service <service-name>-> describe a service lolkubectl get secrets --all-namespaces-> list all secrets, used for storing sensitive data like passwords and keys etckubektl delete pods -l app=[app] -n [namespace]-> delete pods lolkubectl exec -it [pod name] -n [namespace] -- /bin/sh-> exec a shell in the docker container of the podkubectl logs -n [namespace] [pod-name]-> get logs and stuffkubectl get secret [secret] -o yaml-> get some secret, output it to yaml. you will have to decode the password and shit.kubectl get services -w-> watch the serviceskubectl delete service [service]-> deletes a servicekubectl delete -f [file]-> delete a configuration file
Concepts
- Control Plane: master node, which manages workload across the whole system
- API server: serves the kubernetes API
- scheduler
- Nodes: a machine where containers/workloads are deployed
- contains kubelet, nameserver, etc
- Pod: multiple pods in a node.
- ReplicaSet: a replica of the current applications
- StatefulSets: controller that enforce uniqueness etc among pods
Nextcloud
- medium.com/@laurent.roffe_24715/first-nextcloud-deployment-in-k8s-manual-full-steps-eca2566751e7
- falco: xmlisse.wordpress.com/2023/04/27/falco/
- note with falco, we need to install the falco kernel module on all our things. reference this: falco.org/docs/getting-started/falco-kubernetes-quickstart/
← home