kubernetes/service
NodePort Range: 30000 - 32767 ClusterIP LoadBalancer apiVersion: v1 kind: Service metadata: name: myapp-service spec: type: NodePort/ClusterIP (default) ports: -targetPort: 80 — if not specify, gonna be the same as port port: 80 — only required field nodePort: 30008 — any number in the valid range, if not specify, it’s going to be random selector: app: myapp type: front-end k create -f service-def.yaml Access with curl http://192.168.1.2:30008
kubernetes/taint
Taint -> Node Tolerant -> Pod Defines if we are allowed to place a certain pod to a certain node It tells the NODE if he should accept a pod, it doesn’t not guarantee that typed of pods will definitely end up in this node Taint a Node k taint nodes node-name key-value:taint-effect taint-effect defines what happens to the PODs that DO NOT TOLERATE this taint NoSchedule: won’t place this pod on this node...
kubernetes/pod
apiVersion: v1, kind: Pod/ReplicaSet/Deployment/Service metadata – it’s a dictionary name: myapp-pod labels: – any kinda of k-v pairs where you see fit app: myapp spec: – additional information about this obj, what’s inside this obj securityContext: runAsUser: 1000 – userId to run the pod serviceAccountName: dashboard-sa containers: – list name: nginx-container image: nginx ports: -containerPort: 8080 envFrom: secretRef: name: mysecret securityContext: – specify under container instead of pod runAsUser: 1000...
kubernetes/secret
k create secret generic \ mysecret --from-literal=DB_Host=mysql --from-literal=DB_User=root --from-literal=DB_Password=password k create secret generic \ mysecret --from-file=mysecret.properties k get secret mysecret -o yaml will show the hashed values secret-data.yaml apiVersion: v1 kind: Secret metadata – it’s a dictionary name: app-secret labels: – any kinda of k-v pairs where you see fit app: myapp data – similar to ConfigMaps DB_Host: mysql -> encoding with echo -n 'mysql' | base64 DB_User: DB_Password: Inject to a kubernetes/pod apiVersion: v1,...
kubernetes/serviceaccount
k create serviceaccount dashboard-sa Upon creation, the SA generates a toke, then generates a Secret and stored the token in the Secret k describe secret dashboard-sa-token-kbbbm Each namespace has its own default sa k exec -it my-kubernetes-dashboard ls /var/run/serets/kubernetes.io/serviceaccount k exec -it my-kubernetes-dashboard cat /var/run/serets/kubernetes.io/serviceaccount/token to view the token eyJ… decode the above token jq -R 'split(".") | select(length > 0) | .[0],.[1] | @base64 | fromjson' <<< eyJ...
kubernetes
Component Structures Cluster Node Pod: single instance of an application Container Pod2: Container More pods to scale up Node2 Pod: can have multiple containers but mostly different types, share same storage, fate, etc. But it is a RARE situation. Container A Container helper Kubectl Cheat Sheet k run nginx --image nginx --n devNamespace (downloaded from Docker hub, public registry) kubectl run nginx --image=nginx --dry-run=client -o yaml k get pods list all pods available in the current namespace...
2022-09-28 Wednesday
It’s a nice day and we walked to Porter together in order to get my Lab work done. Morning sun shine is so overrated :/ it’s so bright and mighty, almost intrusive - it made me feel small - shamefully small. On the other hand, sunset is a better time to be out there. You can look at the sun and don’t feel judged. It’s so tender and chill, almost non-exist - it made me feel small - comfortably small....
2022-09-22 Thursday
I went to my first Yelp Elite Event for a while in person. It’s a social event. Food was great. Drinks… I don’t know much about. Met some girls to hang out with… hopefully at the next event. Can we be friends? Not sure… here is my official review for the event held at Colette Lounge
2022-09-09 Friday
Shortcuts Useful shortcuts of Logseq Basics to begin with enter + tab creates sub lists, indent it (of course, just like any other MD app!) double enter (or shift + tab) goes back to parent list level cmd + shift + up/down moves the block up and down cmd + enter for TODO shortcut, the order is TODO/DOING/DONE if you keep clicking it shift + enter on page title it will be opened up on the right hand panel, able to edit at the same time...
Logseq Basics
TODO When we have enough shortcuts, we should move them from the 9/9 page to here Play with Admonitions Triggered by <> This is a quote This is a source This is a note This is a tip This is important This is caution This is pinned This is warning This is an example, looks very similar to just ``