This repo contains all the concepts useful to brush up your knowledge in enterprise software development and DevOps.
https://kubernetes.io/docs/concepts/overview/components/ official docs, very useful overview
az acr build --resource-group <rg> --registry <acr> --image <image>:<tag> .
upload image to registry
helm repo add bitnami https://charts.bitnami.com/bitnami
add a helm repohelm search repo bitnami
list available images
kubectl create secret
to keep and spread secretskubectl get endpoints ratings-api --namespace ratingsapp
see what you are exposingkubectl config delete-context <context_name>
clean kubeconfig contextkubectl config set-context <ctx_name> --namespace=<ns>
create a new contextkubectl config use-context <ctx_name>
use context as defaultkubectl port-forward [<pod-name> or services/<service-name>] 8080:80
forward local traffic, to pod or load balancerkubectl cp <pod-name>:<filepath> <filepath>
copy file to local machinekubectl cp $HOME/<filepath> <pod-name>:<filepath>
copy file from remote machine$ kubectl get deployments kuard --export -o yaml > kuard-deployment.yaml $ kubectl replace -f kuard-deployment.yaml --save-config
export a deployment into a file and then store changeskubectl run -i oneshot
run a single job oncekubectl proxy
similar to port forward, but instead of sending TCP traffic you send HTTP requests, port forward is for internal access and debugging, proxy is to forward traffickubectl top nodes
topkubectl expose deployment <my-deplo>
To create a servicek get deploy kuard-deployment -o jsonpath --template {.spec.selector.matchLabels}
Which labels is my deployment matching?kubectl replace -f <filename> --save-config
Replace the deployment in the file and save the modified config in its annotationkubectl rollout status deployments <deployment-name>
Check the rollout statuskubectl label <resource>
____k create configmap test-config --from-file=test-config.txt --from-literal=extra-param=extra-value --from-literal=another-param=another-value
Create ConfigMapk create secret generic <name> --from-file=<filename>
____kubectl replace -f -
Read file from stdin and use it to replace a resource (fx. create with --dry-run -o yaml and then use this to update a secret from files on disk without having to manually base64-encode data)kubectl auth can-i get pods --subresource=logs
Can if I'm auth to do a verbkubectl auth reconcile
Reapply RBAC changeskubectl run -it --rm --image busybox busybox ping <svc dns name>
Run pod interactively and ping
Examples: KUARD_LB=$(kubectl get service kuard -o jsonpath='{.status.loadBalancer.ingress[*].hostname}')
query a specific deployment for a parameter
terraform init --backend-config="<key>=<value>"
____terraform apply -var="<key>=<value>"
pass sensitive variqables from command lineterraform show
look the current state of the infrastructureTF_VAR_<variable>
this environment-variable can be set to set the terraform variable.terraform state list
list all resources provisioned via terraformterraform plan -out=newplan
write the plan into file, you can follow this with <terraform apply "newplan"terraform validate
spellcheck tf files- `` ____
docker run -d --name kuard --publish 8080:8080 gcr.io/kuar-demo/kuard-amd64:blue
____docker stop kuard
____docker system prune
delete all untagged images, all stopped containers etc