Kubernetes Commands (13-29 )

Kubernetes Commands (13-29 )

13. kubectl expose deployment my-deployment --port=8080 --target-port=80 --type=LoadBalancer? ?

- Output: The my-deployment deployment is exposed as a LoadBalancer service on port 8080. ?- Explanation: Creates a service of type LoadBalancer that exposes the my-deployment deployment on port 8080, forwarding traffic to port 80 of the pods.

?

14. kubectl create namespace my-namespace

? - Output: The my-namespace namespace is created. ? ?

- Explanation: Creates a new namespace called my-namespace.

?

15. kubectl get namespaces ?

? - Output: A list of namespaces in the cluster. ? ?

- Explanation: Lists all the namespaces available in the cluster.

?

16. kubectl describe namespace my-namespace

? - Output: Detailed information about the my-namespace namespace. ? ?

- Explanation: Retrieves detailed information about the my-namespace namespace, including its status and resource limits.

?

17. kubectl delete namespace my-namespace

? - Output: The my-namespace namespace is deleted. ? ?

- Explanation: Deletes the my-namespace namespace and all its associated resources.

?

18. kubectl create configmap my-config --from-file=config.ini

? - Output: The my-config ConfigMap is created. ? ?

- Explanation: Creates a ConfigMap called my-config using the contents of the config.ini file.

?

19. kubectl get configmaps: ?

- Output: A list of ConfigMaps in the default namespace. ? ?

- Explanation: Lists all the ConfigMaps available in the default namespace.

?

20. kubectl describe configmap my-config ? ?

- Output: Detailed information about the my-config ConfigMap. ? ?

- Explanation: Retrieves detailed information about the my-config ConfigMap, including its data and associated pods.

?

21. kubectl delete configmap my-config ? ?

- Output: The my-config ConfigMap is deleted. ? ?

- Explanation: Deletes the my-config ConfigMap.

?

22. kubectl create secret generic my-secret --from-literal=password=abc123 ? ?

- Output: The my-secret Secret is created. ? ?

- Explanation: Creates a Secret called my-secret with the key password and the value abc123.

?

23. kubectl get secrets ? ?

- Output: A list of secrets in the default namespace. ? ?

- Explanation: Lists all the secrets available in the default namespace.

?

24. kubectl describe secret my-secret? ?

- Output: Detailed information about the my-secret Secret. ? ?

- Explanation: Retrieves detailed information about the my-secret Secret, including its type and data.

?

25. kubectl delete secret my-secret ? ?

- Output: The my-secret Secret is deleted. ? ?

- Explanation: Deletes the my-secret Secret.

?

26. kubectl create ingress my-ingress --rule=my-domain.com/path=my-service:8080 ? ?

- Output: The my-ingress Ingress is created. ? ?

- Explanation: Creates an Ingress called my-ingress that routes traffic from my-domain.com/path to the my-service service on port 8080.

?

27. kubectl get ingresses ? ?

- Output: A list of ingresses in the default namespace. ? ?

- Explanation: Lists all the ingresses available in the default namespace.

?

28. kubectl describe ingress my-ingress? ?

- Output: Detailed information about the my-ingress Ingress. ? ?

- Explanation: Retrieves detailed information about the my-ingress Ingress, including its rules and backend services.

?

29. kubectl delete ingress my-ingress ? ?

- Output: The my-ingress Ingress is deleted. ? ?

- Explanation: Deletes the my-ingress Ingress.

要查看或添加评论,请登录

Preethi Dovala的更多文章

  • What is Git Cherry-pick?

    What is Git Cherry-pick?

    Watch the below Video about Git Cherry-pick Commit GIT VIDEO In Git, cherry-pick is a command that allows you to apply…

    1 条评论
  • Jenkins Tutorials - 2

    Jenkins Tutorials - 2

    TOPIC: Procedure to Change Jenkins Port to 8081 1. Connect to Your EC2 Instance: - Use SSH to connect to your EC2…

  • Jenkins Tutorials -1

    Jenkins Tutorials -1

    JENKINS VIDEO step-by-step guide for setting up Jenkins on an EC2 instance running Amazon Linux 2 and performing…

  • Kubernetes Commands (30 - 50)

    Kubernetes Commands (30 - 50)

    30. kubectl create serviceaccount my-serviceaccount - Output: The ServiceAccount is created.

  • Kubernetes Commands - (1 - 12)

    Kubernetes Commands - (1 - 12)

    1. kubectl apply -f deployment.

    1 条评论
  • Kubernetes interview question and answers SCENARIO BASED

    Kubernetes interview question and answers SCENARIO BASED

    Scenario: You have a Kubernetes cluster with multiple worker nodes. One of the nodes becomes unresponsive and needs to…

  • Kubernetes interview question and answers for ADVANCED LEVEL

    Kubernetes interview question and answers for ADVANCED LEVEL

    1. Q: What are StatefulSets in Kubernetes, and when would you use them? A: StatefulSets are a Kubernetes controller…

社区洞察

其他会员也浏览了