Home Software Engineering Kubernetes Mastery: Half 3 – Exploring Kubernetes Assets

Kubernetes Mastery: Half 3 – Exploring Kubernetes Assets

0
Kubernetes Mastery: Half 3 – Exploring Kubernetes Assets

[ad_1]

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

Earlier than we start, guarantee you’ve got your Kubernetes cluster up and operating. For those who’ve been following together with the sequence, your KinD cluster ought to already be arrange.

Pods, Deployments, and Companies

1. Record Pods

# Record all pods within the default namespace
kubectl get pods

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

2. Describe a Pod

# Describe a pod by title
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 only a few examples of how one can work together with Kubernetes assets. Kubernetes gives a wealthy set of useful resource sorts for managing purposes and their configurations.

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

[ad_2]