Kubernetes Mastery: Half 3 – Exploring Kubernetes Sources

0
18


Welcome again to the Kubernetes Mastery Sequence! On this third half, we’ll delve into the world of Kubernetes assets and the right way to handle them successfully.

Earlier than we start, guarantee you might have your Kubernetes cluster up and working. Should you’ve been following together with the collection, your KinD cluster ought to already be arrange.

Pods, Deployments, and Providers

1. Record Pods

# Record all pods within the default namespace
kubectl get pods

# Record pods in a selected namespace
kubectl get pods -n <namespace>

2. Describe a Pod

# Describe a pod by identify
kubectl describe pod <pod-name>

3. Scale Deployments

# Scale a deployment to a desired variety of replicas
kubectl scale deployment/<deployment-name> --replicas=<desired-replicas>

4. Replace Deployments

# Replace the picture of a deployment
kubectl set picture deployment/<deployment-name> <container-name>=<new-image>

5. Create a Service

# Create a service to show a deployment
kubectl expose deployment <deployment-name> --port=<port> --target-port=<target-port> --type=NodePort

ConfigMaps and Secrets and techniques

6. Create a ConfigMap

# Create a ConfigMap from literal values
kubectl create configmap <configmap-name> --from-literal=<key1>=<value1> --from-literal=<key2>=<value2>

7. Create a Secret

# Create a Secret from literal values
kubectl create secret generic <secret-name> --from-literal=<key1>=<value1> --from-literal=<key2>=<value2>

Persistent Volumes and Persistent Quantity Claims

8. Create a Persistent Quantity (PV)

# Create a Persistent Quantity
kubectl apply -f pv.yaml

9. Create a Persistent Quantity Declare (PVC)

# Create a Persistent Quantity Declare
kubectl apply -f pvc.yaml

Namespaces

10. Create a Namespace

# Create a brand new namespace
kubectl create namespace <namespace-name>

These are just some examples of how one can work together with Kubernetes assets. Kubernetes gives a wealthy set of useful resource sorts for managing functions and their configurations.

Keep tuned for the following half in our Kubernetes Mastery Sequence:
Half 4 – Deploying Stateful Functions