Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Nirmal
Nirmal

Posted on

     

Kubernetes - Refresher Notes

This post is for anyone to quickly refresh on the phrases in Kubernetes. If you are starting to explore Kubernetes then this can be used as a checklist on the areas you should be aware of. I have also included some basic commands to work with kubernetes.

Concepts :

  • KUBECONFIG
  • Cluster - Master & Worker
  • Node
  • Node Port
  • ClusterIP
  • Statefulset vs Statetless
  • Deployment
  • Service
  • Pod
  • Namespace
  • Context
  • PersistentVolume
  • PersistentVolumeClaim
  • HostPath (Local)
  • Ingress
  • LoadBalancer
  • ConfigMap
  • Secrets
  • DNS (..svc.cluster.local)
  • KubeAdmin
  • RBAC
  • ServiceAccount
  • Rollout
  • Replica Scale

Scripts

  • Annotations,Labels & Selectors
  • Kustomize (-k vs -f)
  • Apply/Create/Patch

Local Kubernetes Setup :

  • Docker for Desktop Mac
  • MiniKube

Tools

  • Kubernetes Dashboard - web UI for Kubernetes clusters
  • Kubectl and Proxy
  • Kubernetic Desktop - View Cluster Resources, Similar to Kitematic for Docker.
  • Sekret - Encryption Tool for Kubernetes Secrets YAML
  • Kamus - Encryption and Decryption solution for Kubernetes applications
  • Kubectx - Switch faster between clusters and namespaces in kubectl
  • kube-ps1 - Kubernetes prompt info for bash and zsh to see the current cluster context with namespace
  • Kubefwd - Bulk port forwarding Kubernetes services for local development.

Basic Commands

Contexts

# Get all contextskubectl config get-contexts # Get Current Contextkubectl config current-context# Set the default contextkubectl config use-context nk-dev-cluster  kubectl config set-context nk-dev --namespace=rafa-dev --cluster=docker-for-desktop-cluster --user=docker-for-desktop

Describe K8 Resources

# kubectl describe <resource> <resourceName>kubectl describe pods pod1# Get the resource definition in yamlkubectl get pod my-pod -o yaml

Expose a Service

#expose a app named web-app as a service kubectl expose deployment web-app --name=web-app --type=NodePort --target-port=8080# For Testing Locallykubectl port-forward servicename 8080:8080

Connect to the running Pod Container

kubectl exec web-app-fcc6b5ddf-k2txq -it -- /bin/sh

Troubleshooting

#Simple Container to quickly run some curl commands to the podskubectl run curl-test --image=radial/busyboxplus:curl -i --tty --rm

Thanks for reading this refresher.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp