Meetings with Michal Jakubowicz
Outline? Can be published? Prolly Not.
Cluster API book
It is a kind?
Custom Resource Definition
As the name says
Service containing Controller that works on custom resources.
Controller is something reacting to change in custom resources.
Controller is a process that can access k8s api.
It should be responsible for some Resource/Custom Resource.
Sevice Account is binded to Pod.
Scoped, Custer, Service Accounts
Adding user to Rancher and getting access to kubectl
- As Admin: Go to settings as admin and assign role to recently logged user
- Log in
- Download kubeconfig
export KUBECONFIG=$(realpath kubeconfig_file)
- kubectx and kubens: for changing default clusters/namespaces
- kubens will use
- fzf can be plugged in to zsh
- kubens will use
- k9s for graphical scrolling
Creating New Service($strategy = nothing)
- create namespace:
kubectl create namespace spotty-kiwi
kubens- change to this namespace
- create deployment
kubectl get all- see if it works?
kubectl logs $id
kubectl describe $pod- see the full state of pod
- execute $strategy
Moving Existing Service from Docker Compose to K8S
- -> with deployment strategy below
kubectl cp from $pod:to
kubectl rollout restart $deployment-> if you need to restart shit
- zoxide - remembers most frquently used folder
- use oxide instead of CTRLP
- ciW - change inside Word
- zsh: alias-tips - prompts for my aliases
kubectl explain deploy- Shows explanation from CustomResourceDefinition
- Straight from cluster definitions
explain --recursivefor all
One page api reference for k8s
kind: For example Deployment apiVersion: group/version medatada: usually has to be something name: (name that you will be using) namespace: (k8s namespace or it will pick spec: replicas: selector: matchLabels: app: (it will find all apps to managa in deployment) template: metadata: labels: app: (should be label to be matched) spec: containers: - name: (just name) image: (image name) ports: (usually unneeded but nice for naming ports) env: - name: (SOME NAME) value: (???) valueFrom: secretRefKey name: SECRETS key: key envFrom: - secretRef: name: SECRETS - configMapRef: name: XD volumeMounts: - name: claim-name mountPath: some-path volumes: (per many containers) presistentVolumeClaim claimName: claim-name --- <<ConfigMap>> ---
kind: Secret apiVersion: v1 metadata: usually has to be something name: SECRETS namespace: stringData: BOT_TOKEN: XXX
echo -n "51K8dxKBW7NdbUsimlojLw7AQqLwB" | base64 -w 0
Persistent Volume Claims Yaml
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: claim-name namespace: ??? spec: storageClass: local-path (for example local-path, but will be default) // volumeName: claim-name: Don't use it in local-path if you don't Pcreate PV by hand accessModes: [ReadWriteOnce] - ReadWriteOnce (only one pod) resources: request: storage: 100m