kubectl

Descrição

Mapa Mental sobre kubectl, criado por Luiz Eduardo em 19-03-2022.
Luiz  Eduardo
Mapa Mental por Luiz Eduardo, atualizado more than 1 year ago
Luiz  Eduardo
Criado por Luiz Eduardo aproximadamente 2 anos atrás
322
0

Resumo de Recurso

kubectl

Anotações:

  • https://kubernetes.io/docs/reference/kubectl/cheatsheet/https://kubernetes.io/docs/reference/kubectl/ https://kubernetes.io/docs/reference/kubectl/
  1. Useful
    1. kubectl create

      Anotações:

      • Run kubectl create to see a list of objects that can be created with imperative commands.
      1. kubectl create deployment my-deployment --image=nginx

        Anotações:

        • Create a deployment imperatively.
        1. kubectl create deployment my-deployment --image=nginx --dry-run -o yaml

          Anotações:

          • Do a dry run to get some sample yaml without creating the object.
          1. kubectl create deployment my-deployment --image=nginx --dry-run -o yaml > deployment.yml

            Anotações:

            • Save the yaml to a file.
            1. kubectl create -f deployment.yml

              Anotações:

              • Create the object using the file.
              1. kubectl scale deployment my-deployment replicas=5 --record

                Anotações:

                • Scale a deployment and record the command.
                1. kubectl describe deployment my-deployment
                  1. kubectl apply -f FILENAME [flags]
                    1. kubectl drain NODE [options]
                      1. kubectl delete (-f FILENAME | TYPE [NAME | /NAME | -l label | --all]) [flags]
                        1. kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | /NAME | -l label]) [flags]
                          1. kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]
                            1. kubectl expose
                              1. kubectl label
                                1. kubectl logs POD [-c CONTAINER] [--follow] [flags]
                                  1. kubectl port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N] [flags]
                                    1. kubectl uncordon NODE [options]
                                      1. kubectl version [--client] [flags]
                                        1. kubectl api-resources
                                          1. kubectl get pods <pod-name> --server-print=false
                                            1. kubecyl apply
                                              1. kubectl apply -f example-service.yaml

                                                Anotações:

                                                • # Create a service using the definition in example-service.yaml.
                                                1. kubectl apply -f example-controller.yaml

                                                  Anotações:

                                                  • # Create a replication controller using the definition in example-controller.yaml.
                                                  1. kubectl apply -f <directory>

                                                    Anotações:

                                                    • # Create the objects that are defined in any .yaml, .yml, or .json file within the &lt;directory&gt; directory.
                                                  2. kubectl get
                                                    1. kubectl get pods -o wide
                                                      1. kubectl get replicationcontroller <rc-name>

                                                        Anotações:

                                                        • # List the replication controller with the specified name in plain-text output format. Tip: You can shorten and replace the 'replicationcontroller' resource type with the alias 'rc'.
                                                        1. kubectl get rc,services

                                                          Anotações:

                                                          • # List all replication controllers and services together in plain-text output format.
                                                          1. kubectl get ds

                                                            Anotações:

                                                            • # List all daemon sets in plain-text output format.
                                                            1. kubectl get pods --field-selector=spec.nodeName=server01

                                                              Anotações:

                                                              • # List all pods running on node server01
                                                              1. kubectl get pods -n kube-system
                                                                1. kubectl get pods -n kube-system --selector k8s-app=calico-node
                                                                  1. kubectl get pv

                                                                    Anotações:

                                                                    • kubectl get pv -o yaml&nbsp; _____to get the values and sort them&nbsp; --sort-by=.spec....
                                                                    1. kubectl get pv --sort-by=.spec.capacity.storage
                                                                  2. kubectl config get-contexts
                                                                    1. kubectl config current-context
                                                                      1. kubectl config use-context my-cluster-name
                                                                        1. kubectl config set-context --current --namespace=ggckad-s2
                                                                          1. kubectl config set-context gce --user=cluster-admin --namespace=foo \ && kubectl config use-context gce
                                                                            1. kubectl get pods -n beebox-mobile --kubeconfig /home/cloud_user/dev-k8s-config
                                                                              1. kubectl top po -n beebox-mobile --sort-by=cpu --selector=app=auth > /home/cloud_user/cpu-pod-name.txt
                                                                              2. output systax
                                                                                1. kubectl [command] [TYPE] [NAME] -o <output_format>

                                                                                  Anotações:

                                                                                  • The default output format for all&nbsp;kubectl&nbsp;commands is the human readable plain-text format. To output details to your terminal window in a specific format, you can add either the&nbsp;-o&nbsp;or&nbsp;--output&nbsp;flags to a supported&nbsp;kubectl&nbsp;command.
                                                                                  1. Output format
                                                                                    1. -o custom-columns=<spec>

                                                                                      Anotações:

                                                                                      • Print a table using a comma separated list of&nbsp;custom columns.
                                                                                      1. kubectl get pods <pod-name> -o custom-columns=NAME:.metadata.name,RSRC:.metadata.resourceVersion
                                                                                      2. -o custom-columns-file=<filename>

                                                                                        Anotações:

                                                                                        • Print a table using the&nbsp;custom columns&nbsp;template in the&nbsp;&lt;filename&gt;&nbsp;file.
                                                                                        1. kubectl get pods <pod-name> -o custom-columns-file=template.txt

                                                                                          Anotações:

                                                                                          • where the&nbsp;template.txt&nbsp;file contains: NAME RSRC metadata.name metadata.resourceVersion
                                                                                        2. -o json

                                                                                          Anotações:

                                                                                          • Output a JSON formatted API object.
                                                                                          1. -o jsonpath=<template>

                                                                                            Anotações:

                                                                                            • Print the fields defined in a&nbsp;jsonpath&nbsp;expression.
                                                                                            1. -o jsonpath-file=<filename>
                                                                                              1. -o name
                                                                                                1. -o wide
                                                                                                  1. -o yaml
                                                                                                    1. kubectl get pod web-pod-13je7 -o yaml
                                                                                                2. kubectl get clusterrolebindings

                                                                                                  Semelhante

                                                                                                  Como criar um Mapa Mental
                                                                                                  Alessandra S.
                                                                                                  ÉTICA e CONCEITOS
                                                                                                  Viviana Veloso
                                                                                                  Processos PMBOK 5ª edição
                                                                                                  Clenia Paradela
                                                                                                  Resumo global da matéria de Biologia e Geologia (10.º e 11.º anos)_2
                                                                                                  ana-carolina12re
                                                                                                  Respiração aeróbia - 10º ano
                                                                                                  hlopes047
                                                                                                  Sistema Endócrino
                                                                                                  Gabriel Paes
                                                                                                  Índios no Brasil
                                                                                                  luciahelenaferre
                                                                                                  Química Orgânica
                                                                                                  Johnny Henrique
                                                                                                  Grandes Navegações e Período Pré-Colonial (1490 - 1540)
                                                                                                  Isadora Borges
                                                                                                  MAPA MENTAL
                                                                                                  luciano.silva
                                                                                                  Metonímia
                                                                                                  Diogo Alcantara