bmctl
é uma ferramenta de linha de comando para o Google Distributed Cloud que simplifica a criação e o gerenciamento de clusters. Este documento é uma referência abrangente dos comandos bmctl
e flags relacionadas.
Antes de começar
O bmctl
usa o Application Default Credentials (ADC, na sigla em inglês)
para validar o valor location
na especificação do cluster
(clusterOperations.location
) quando ele não estiver definido como global
. Essa validação é obrigatória para muitos comandos bmctl
. Para que o ADC funcione, siga um destes procedimentos:
Defina a variável de ambiente
GOOGLE_APPLICATION_CREDENTIALS
no administrador da estação de trabalho para o caminho de um arquivo de credencial da conta de serviço.Utilize suas credenciais de usuário da gcloud CLI como Application Default Credentials (ADC):
gcloud auth application-default login
Alguns comandos bmctl
permitem especificar um caminho para um arquivo de credenciais com uma sinalização.
backup
Faça backup das informações do cluster.
Opções
-h, --help help for backup
cluster de backup
Faça backup de um cluster e salve o backup em um arquivo .tar.
backup cluster [flags]
Opções
--backup-file string path to the output backup files.
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--use-disk Perform the backup using the disk instead of in-memory
buffer. This option only works when the command is run
by the root user or with sudo.
--yes Perform the backup and do not prompt for confirmation
(non-interactive mode).
Para mais informações sobre como fazer backup e restaurar clusters com bmctl
, consulte
Fazer backup e restaurar clusters com o bmctl.
check
Execute verificações de simulação ou de integridade nos clusters ou na infraestrutura.
Opções
-h, --help help for check
verificar complementos
Verifique a integridade operacional dos complementos do cluster, como
stackdriver-log-aggregator
, stackdriver-log-forwarder
e
gke-connect-agent
.
check add-ons [flags]
Exemplos
# Do a health check for add-ons
bmctl check add-ons --cluster=cluster1
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for add-ons
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
verificar cluster
Verifique a integridade de um cluster ou gere um snapshot do cluster.
check cluster [flags]
Exemplos
# Do a health check for cluster.
bmctl check cluster --cluster=cluster1
# Take a snapshot of the cluster (requires admin cluster to be available).
bmctl check cluster --snapshot --cluster=cluster1 --admin-kubeconfig=admin-kubeconfig
# Take a snapshot of the cluster (requires admin cluster to be available) using 30 threads.
bmctl check cluster --snapshot --cluster=cluster1 --admin-kubeconfig=admin-kubeconfig --num-of-parallel-threads=30
# Take a snapshot of the cluster nodes only (does not require admin cluster to be available).
bmctl check cluster --snapshot --cluster=cluster1 --snapshot-config=snapshot-config
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default "192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default "10.96.0.0/27")
--ca-file string The file contains the Node Agent server CA certificate for authenticating nodes to capture snapshots. While this flag is fully optional, when provided, nodes must also be provided.
--cert-file string The file contains the Node Agent client certificate for authenticating with nodes to capture snapshots. While this flag is fully optional, when provided, nodes must also be provided.
-c, --cluster cluster name Cluster name, cluster config is expected to be placed under <workspace dir>/<cluster name>/<cluster name>.yaml
--enforce-allowlist Enforces allowlist checking for kubectl/node commands executed as part of collecting snapshot that they are read-only. Commands not allowed will be skipped. (default true)
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed despite the validation errors.
--key-file string The file contains the Node Agent client private key for authenticating with nodes to capture snapshots. While this flag is fully optional, when provided, nodes must also be provided.
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
--local Save the snapshot on your workstation only. This will allow you to explicitly opt out of uploading the snapshot to Google Cloud.
--login-user string The user to login to each node. This will be ignored when admin-kubeconfig is set. (default "root")
--node-ssh-key string The file contains ssh key to the nodes to capture snapshots against. While this flag is fully optional, when provided, nodes must also be provided.
--nodeagent-port int The Node Agent server port for the client side to connect to. This flag is optional and only applies with 'nodes' options; when provided, it will override the default port.
--nodes strings The comma-separated IP address list of the nodes to capture snapshots against. While this flag is fully optional, when provided, node-ssh-key must also be provided.
--num-of-parallel-threads int The number of parallel threads used for processing snapshots. Note that --snapshot-config and --num-of-parallel-threads flags cannot be used at the same time. (default 10)
--quiet During snapshot run suppress logging to stdout. (Console log is available in 'bmctl_diagnose_snapshot.log' file part of the snapshot)
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--service-account-key-file string The service account key file that is needed to upload the snapshot to your Google Cloud Storage bucket and provision a dedicated Google Cloud service account for your project to facilitate snapshot sharing with Google.
Make sure that the service account key has the ability to create and list buckets and objects in your project.
We recommend creating a custom role with the following permissions and assigning this custom role to your service account:
- storage.buckets.create
- storage.buckets.get
- storage.buckets.list
- storage.objects.create
- resourcemanager.projects.get
Note that all the storage permissions fall under the "roles/storage.admin" IAM role. You can also use that role, but it is too powerful and is not recommended
Note that:
- this flag is defaulted to the environment variable GOOGLE_APPLICATION_CREDENTIALS, if not provided.
- this flag is ignored, if "--upload-to" flag is empty.
--since duration This Only returns logs newer than a relative duration like 5s, 4m, or 3h. It defaults to all logs.
--snapshot Takes a snapshot of the cluster's logs, configurations and other data if true.
Note that if a service account key is provided either throuh the flag --service-account-key-file or GOOGLE_APPLICATION_CREDENTIALS, the snapshot will be automatically uploaded to your Google Cloud Storage bucket. Also, a dedicated Google Cloud service account for your project will be provisioned for your project to facilitate snapshot sharing with Google.
Use --local to opt out of snapshot uploading.
--snapshot-config --enforce_allowlist=false The config file of the snapshot. When this flag is omitted, a default configuration is applied. An allowlist enforcing read-only commands is in effect by default, to bypass it specify --enforce_allowlist=false option. Note that --snapshot-config and --num-of-parallel-threads flags cannot be used at the same time.
--snapshot-dry-run In dry-run mode, the command does not take the snapshot. Instead, it prints out the actions to be taken and the snapshot configuration.
--snapshot-output string The output file of the snapshot.
--snapshot-scenario string The scenario of the snapshot. This is ignored when --config flag is specified. The supported scenarios are:
- system: snapshot of system components, including their logs
- all: snapshot of all pods, including their logs (default "system")
--snapshot-temp-output-dir string The temporary landing directory for snapshot.
--upload-to string The Google Cloud Storage bucket name for uploading the snapshot. A new bucket will be created if it doesn't exist. Please follow the naming guidelines here(https://cloud.google.com/storage/docs/naming-buckets).
Configuração de verificações
Verifique o arquivo de configuração do cluster.
check config [flags]
Exemplos
# Do check for cluster1.yaml file
bmctl check config --cluster=cluster1
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for config
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
verificar o gcp
Conectividade do cluster com a verificação de integridade do Google Cloud.
check gcp [flags]
Exemplos
# Do a machines' Google Cloud connectivity health check for cluster
bmctl check gcp --cluster=cluster1
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for gcp
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
Verificar Kubernetes
Verificação de integridade do Kubernetes.
check kubernetes [flags]
Exemplos
# Do a kubernetes health check for cluster
bmctl check kubernetes --cluster=cluster1
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for kubernetes
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
verificar nós
Verifique a integridade dos nós.
check nodes [flags]
Exemplos
# Do a health check for some provisioned nodes
bmctl check nodes --addresses=192.168.0.1,192.168.0.4
Opções
--addresses strings Node addresses, addresses should be a comma separated
list, each address needs be a single IP address(e.g.,
192.168.0.1)
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for nodes
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
verificar simulação
Verificação de simulação.
Sinopse
Verificação de simulação.
check preflight [flags]
Exemplos
# Do a preflight check for cluster1.yaml in bmctl-workspace/cluster1
bmctl check preflight --cluster=cluster1
# If kubeconfig flag (for example, --kubeconfig=bmctl-workspace/cluster1/cluster1-kubeconfig) is
# included, the command will trigger a preflight check for upgrading the cluster
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for preflight
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
check vmruntimepfc
Verificação de simulação do ambiente de execução de VM para GDC.
check vmruntimepfc [flags]
Exemplos
# Do vmruntime preflight check,
bmctl check vmruntimepfc --kubeconfig=$KUBECONFIG
Opções
-h, --help help for vmruntimepfc
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
Para mais informações sobre verificações de simulação, consulte Noções básicas sobre verificações de simulação.
configure
Configure contas de serviço e papéis do IAM e ative as APIs no Google Cloud para autenticação de cluster de identidade da carga de trabalho.
Opções
-h, --help help for configure
configurar projetos
Configura vinculações de políticas do IAM para autenticação de cluster de identidade da carga de trabalho. Cria as contas de serviço necessárias e ativa as APIs necessárias.
configure projects [flags]
Opções
--admin-cluster string admin cluster name
--cloud-ops-service-account string cloud ops service account
--controller-service-account string controller GCP service account
--gcr-service-account string GCR image pull service account
-h, --help help for projects
--location string GKE hub membership location (default "global")
--project-id string GCP project used in GKE connect
--proxy-url string proxy URL for accessing GCP services. If not specified,
bmctl looks for env variables HTTPS_PROXY and HTTP_PROXY
--user-clusters string one or more comma-delimited user cluster names
Para mais informações sobre como ativar e usar a autenticação de cluster de identidade da carga de trabalho, consulte Autenticação de cluster de identidade da carga de trabalho.
create
Crie um arquivo de configuração de cluster, um cluster ou uma conta de serviço do Kubernetes (KSA).
Opções
-h, --help help for create
Criar cluster
Crie um cluster a partir de um arquivo de configuração.
Sinopse
Crie recursos do Google Distributed Cloud. Esse comando vai emitir um kubeconfig de um cluster criado. Mantenha esse arquivo seguro, já que ele contém credenciais para o cluster. Esse comando requer a permissão serviceusage.services.get
para verificar a ativação da API no seu projeto do Google Cloud.
create cluster [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
--force If true, ignore errors from preflight checks and
validation except for Google Cloud check errors.
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
Para mais informações sobre como criar clusters, consulte Visão geral da criação de clusters.
criar config
Criar um arquivo de configuração de cluster Por padrão, esse arquivo é criado na pasta bmctl-workspace/<cluster_name>.
create config [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
--create-service-accounts Auto create GCP service accounts keys, if they do not
already exist in workspace
--enable-apis Auto enable APIs used by Bare Metal cluster,
for the GCP Project specified by project-id flag
--force Overwrite existing config
-h, --help help for config
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--project-id string GCP project where the new cluster will connect with
via GKE hub and stackdriver logging/monitoring,
required if --create-service-accounts or
--enable-apis is true
--proxy-url string Proxy URL for accessing GCP services. If not
specified, bmctl will look for env variable
HTTPS_PROXY and HTTP_PROXY
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
criar KSA
Crie uma conta de serviço do Kubernetes com o papel de administrador do cluster do cluster de destino.
O nome padrão da conta de serviço do Kubernetes é kubernetes-service-account
, então a flag --name
é opcional.
O comando gera um token do portador que pode ser usado para fazer login no cluster.
Por padrão, o token do portador é armazenado na pasta bmctl-workspace/<cluster_name>
.
create ksa [flags]
Opções
-c, --cluster string Cluster name, cluster config is expected to be placed under
<workspace dir>/<cluster name>/<cluster name>.yaml.
-h, --help help for ksa
--ksa-name string Name of the kubernetes service account and default value is
kubernetes-service-account. (default "kubernetes-service-account")
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
desativar
Desative o ambiente de execução de GVM para GDC em um cluster.
Opções
-h, --help help for disable
desativar vmruntime
Desative o ambiente de execução de VM para GDC em um cluster.
disable vmruntime [flags]
Opções
--force If true, delete all VM resources and disable vmruntime.
-h, --help help for vmruntime
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
Para mais informações sobre como ativar e desativar o ambiente de execução da VM no GDC, consulte Ativar ou desativar o ambiente de execução da VM no GDC.
ativar
Ativar o ambiente de execução de VM para GDC em um cluster.
Opções
-h, --help help for enable
ativar vmruntime
Ativar o ambiente de execução de VM para GDC em um cluster.
enable vmruntime [flags]
Opções
-h, --help help for vmruntime
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
Para mais informações sobre como ativar e desativar o ambiente de execução da VM no GDC, consulte Ativar ou desativar o ambiente de execução da VM no GDC.
get
Recebe uma configuração ou credenciais de cluster.
Opções
-h, --help help for get
Obter config
Consiga o arquivo de configuração do cluster. O comando extrai recursos personalizados do cluster de destino e emite um arquivo de configuração.
get config [flags]
Opções
-c, --cluster string Cluster name, cluster config is expected to be placed under
<workspace dir>/<cluster name>/<cluster name>.yaml.
-h, --help help for config
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
Para mais informações, consulte Receber detalhes da configuração do cluster.
Receber credenciais
Receba as credenciais do cluster de destino. O comando cria um arquivo kubeconfig na pasta <workspace dir>/<cluster name>
da
estação de trabalho do administrador.
get credentials [flags]
Opções
-c, --cluster string Cluster name, cluster config is expected to be placed under
<workspace dir>/<cluster name>/<cluster name>.yaml.
-h, --help help for credentials
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
Para mais informações, consulte Receber credenciais de cluster.
instalar
Realiza operações de instalação de software.
Opções
-h, --help help for install
Instalar virtctl
Instale o virtctl
na máquina atual como um plug-in kubectl
. O plug-in virtctl
é compatível com operações básicas de VM, como criar, conectar e mudar o estado de energia.
install virtctl [flags]
Opções
-d, --dst-dir string The dir virtctl binary to be installed, this path must be a valid one within
PATH env variable
-h, --help help for virtctl
move
Mova os recursos do Google Distributed Cloud e todas as dependências entre clusters de gerenciamento.
- O namespace do cluster de destino pode conter recursos adicionais. Recursos conflitantes são substituídos.
move [flags]
Opções
--cluster-move-timeout duration Cluster move timeout, default value is 15m. The input should
contain the duration unit, e.g. 3600s, 60m or 1h. (default
15m0s)
--from-kubeconfig string kubeconfig file path for the source management cluster. If
unspecified, will use the default discovered kubeconfig.
--from-kubeconfig-context string Context to be used within the kubeconfig file for the source
management cluster. If empty, current context will be used.
-h, --help help for move
-n, --namespace string The namespace where the cluster resources are stored. If
unspecified, the current context's namespace is used.
--to-kubeconfig string kubeconfig file path for the destination management cluster.
--to-kubeconfig-context string Context to be used within the kubeconfig file for the
destination management cluster. If empty, current context
will be used.
nodeagent
Gerencie a implantação do agente de nó.
Sinopse
Fornece comandos para gerenciar o serviço do agente de nó em nós de cluster.
Opções
-h, --help help for nodeagent
nodeagent deploy
Implante com SSH o serviço do agente do nó nos nós especificados.
Sinopse
Implante o serviço do agente de nó em um ou mais nós de destino em um cluster especificado usando SSH.
Esse comando pode instalar ou reinstalar o agente de nó. Ele se conecta por SSH e realiza as etapas necessárias, incluindo a transferência de binários, a geração e transferência de certificados (opcional) e a configuração do serviço systemd.
Ele exige acesso SSH e privilégios de superusuário nos nós de destino.
Esse comando processa a configuração inicial e a recuperação do agente de nó.
Os nós de destino podem ser especificados de várias maneiras: diretamente usando a flag --nodes
, por um arquivo de configuração do cluster usando a flag --cluster
ou referenciando o recurso personalizado do cluster.
nodeagent deploy [flags]
Opções
--cluster string Name of the target cluster (required).
--concurrency int Number of parallel node deployments. (default 25)
--deploy-creds Deploy the server certificate, private key and client CA to nodes. (default true)
--enforce-host-key-verify Verifies the remote host's SSH key against known_hosts (recommended). (default true)
--generate-ca-creds Generate necessary CAs and client credentials for Node Agent.
-h, --help help for deploy
--key-algorithm string The private key algorithm for the CA, client certificatem and server certificate. (default "rsa")
--key-length int The private key length for the CA, client certificate and server certificate. (default 4096)
--kubeconfig string Path to the cluster kubeconfig.
--nodeagent-version string The Node Agent version to pull. (default "0.0.0-gke.0")
--nodes strings List of node IPs to deploy to (comma-delimited).
--non-interactive Run non-interactively, skipping all user prompts.
--port string The Node Agent port. (default "9192")
--pull-binaries Download Node Agent binaries.
--sa-key string Path to the service account key to pull from GCS and GCR.
--server-cert-validity int The validity for the server certificate. (default 1825)
--ssh-key string Path to the SSH private key file. (default "~/.ssh/id_rsa")
--ssh-user string SSH username for connecting to nodes. (default "root")
nodeagent enable
Ativa o modo de agente de nó para o cluster em execução.
Sinopse
Ativa o modo de agente de nó para um cluster.
Esse comando modifica a configuração do cluster e também cria ou atualiza as credenciais relacionadas necessárias para que esse modo funcione.
Quando o modo do agente de nó está ativo, o gerenciamento do cluster é feito pelo agente de nó executado diretamente em cada nó.
nodeagent enable [flags]
Opções
--client-ca-key-path string Path for the client certificate key file.
--client-ca-path string Path for the client ca certificate file.
--client-cert-path string Path for the client cacertificate file.
--client-key-path string Path for the client private key file.
-c, --cluster string Name of the target cluster (required).
--ensure-status Ensure Node Agent running status on all node in the cluster. (default true)
-h, --help help for enable
-k, --kubeconfig string Path to the kubeconfig file (required).
--port string The Node Agent port. (default "9192")
--server-ca-key-path string Path for the server ca key file.
--server-ca-path string Path for the server ca file.
nodeagent rotate-credentials
Faz a rotação das credenciais do agente de nó nos nós especificados usando SSH e dentro do cluster.
Sinopse
Gira as credenciais nodeagentd
em um ou mais nós de destino usando SSH. Esse comando também atualiza a credencial do agente de nó correspondente armazenada no cluster.
Esse comando pode fazer a rotação das credenciais do agente de nó. Ele exige acesso SSH e privilégios de superusuário nos nós de destino.
Os nós de destino podem ser especificados de várias maneiras: diretamente usando a flag --nodes
, por um arquivo de configuração do cluster usando a flag --cluster
ou referenciando o recurso personalizado do cluster.
nodeagent rotate-credentials [flags]
Opções
--cluster string Name of the target cluster (required).
--concurrency int Number of parallel node deployments. (default 25)
--enforce-host-key-verify Verify remote host's SSH key against known_hosts. (default true)
--generate-ca-creds Generate necessary CAs and client credentials for Node Agent.
-h, --help help for rotate-credentials
--key-algorithm string The private key algorithm for the CA, client certificatem and server certificate. (default "rsa")
--key-length int The private key length for the CA, client certificate and server certificate. (default 4096)
--kubeconfig string Path to the cluster kubeconfig.
--nodes strings List of node IPs to deploy to (comma-delimited).
--non-interactive Run non-interactively, skipping all user prompts.
--server-cert-validity int The validity for the server certificate. (default 1825)
--ssh-key string Path to the SSH private key file. (default "~/.ssh/id_rsa")
--ssh-user string SSH username for connecting to nodes. (default "root")
status do nodeagent
Verifique o status de execução do agente de nó nos nós do cluster.
Sinopse
Verifique o status de execução do agente de nó nos nós do cluster.
Os nós de destino podem ser especificados de várias maneiras: diretamente usando a flag --nodes
, por um arquivo de configuração do cluster usando a flag --cluster
ou referenciando o recurso personalizado do cluster.
nodeagent status [flags]
Opções
--client-cert-path string Path for the client certificate file.
--client-key-path string Path for the client private key file.
-c, --cluster string Name of the target cluster (required).
-h, --help help for status
-k, --kubeconfig string Path to the kubeconfig file.
--nodes strings List of node IPs to deploy to (comma-delimited).
--port string The Node Agent port. (default "9192")
--server-ca-path string Path for the server ca file.
push
Enviar imagens do Docker para um registro particular.
Opções
-h, --help help for push
enviar imagens
Envie o arquivo .tar das imagens de contêiner locais para um registro particular.
push images [flags]
Opções
--cacert string Private registry CA certificate file path.
--dry-run Dry run.
--email string Email for private registry.
--force-push If set to true, will always push images even if images already exist
in registry.
--format string Format of images in the source file. Should be one of tarball or oci
(default). (default "oci")
-h, --help help for images
--need-credential Whether credential is needed for private registry. (default true)
--password string Password for private registry authentication.
-r, --private-registry string Private registry path that stores all bare metal images.
Format should be <registry-name>/<optional-registry-namespace>.
--source string Path to bare metal container images compressed file.
-t, --threads int Push images with multiple threads. (default 4)
--username string Username for private registry authentication.
Para informações sobre como configurar e usar um espelho de registro para as imagens de contêiner do Bare Metal, consulte Usar um espelho de registro para imagens de contêiner.
fazer inscrição
Registrar recursos.
Opções
-h, --help help for register
registrar bootstrap
Registrar cluster de inicialização na API Hub.
Sinopse
Registre o cluster de inicialização na API Hub. Esse comando registra um cluster de tipo local como um cluster de administrador. O comando aguarda a criação de um cluster no console do Google Cloud e é encerrado quando ele é criado.
register bootstrap [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
--cloud-operation-service-account-key string Optional, service account key file used to
access Google cloud service, service account
key specified by environment variable
GOOGLE_APPLICATION_CREDENTIALS will be used to
fetch or create the Service account.
--enable-apis Auto enable APIs used by bare metal
cluster, for the GCP Project specified by
project-id flag
--gcr-service-account-key string Optional, service account key file used to
pull Artifact Registry images, service account key
specified by environment variable
GOOGLE_APPLICATION_CREDENTIALS will be used to
fetch or create the Service account.
--gke-agent-service-account-key string Optional, service account key file used to
connect the GKE cluster in Google Cloud,
service account key specified by environment
variable GOOGLE_APPLICATION_CREDENTIALS will
be used to fetch or create the Service
account.
--gke-register-service-account-key string Optional, service account key file used to
register the cluster in Google Cloud, service
account key specified by environment variable
GOOGLE_APPLICATION_CREDENTIALS will be used to
fetch or create the Service account.
-h, --help help for bootstrap
--ignore-validation-errors A validation error override, allowing to
proceed despite the validation errors.
--location string Optional, Location of the GKEHub Membership,
e.g. us-central1. If unspecified, global will
be used. (default "global")
--name string Mandatory (either --name or
--target-cluster-name needs to be provided),
Name of the bootstrap cluster. bmctl will
register the bootstrap cluster with this name
with GKE Connect.
--project-id string Optional, GCP project for GKE Connect. bmctl
will register this bootstrap cluster into GCP
project temporarily, and un-register it after
cluster is provisioned successfully.
--registry-mirror-ca string Registry mirror CA file.
--registry-mirror-credential string Registry mirror credential file.
--registry-mirror-endpoint string Registry mirror endpoint.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--ssh-client-cert string Optional, Path of the SSH certificate. ABM
will use this ssh key certificate while sshing
in the machines.
--ssh-key string Mandatory, Path of the SSH key. ABM will use
this ssh key while sshing in the machines.
--target-cluster-name string Optional, The target cluster name.
redefinir
Redefina as máquinas do cluster para o estado anterior à instalação.
Sinopse
Este comando tenta desfazer alterações realizadas em tentativas de instalação anteriores. É a melhor tentativa de recuperação para falhas parciais de instalação.
reset [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for reset
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
redefinir bootstrap
Exclua o cluster de inicialização.
reset bootstrap [flags]
Exemplos
bmctl reset bootstrap
Opções
-h, --help help for bootstrap
redefinir nós
Remova os nós especificados de um cluster para redefinir o estado pré-instalado deles. Nos casos em que os nós estão inacessíveis, use
a opção --force
para ignorar a etapa de redefinição. Se o plano de controle do cluster estiver
inacessível, use as opções --ssh-private-key-path
, --login-user
e
--gcr-service-account-key
para redefinir os nós especificados para o
estado pré-instalado sem excluí-los do cluster.
reset nodes [flags]
Exemplos
bmctl reset nodes --addresses 10.200.0.10,10.200.0.11 --cluster cluster1 --kubeconfig admin-kubeconfig
Opções
--addresses strings Node addresses, addresses should be a comma separated list, each address needs be a single IP address(e.g., 192.168.0.1)
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default "192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default "10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed under <workspace dir>/<cluster name>/<cluster name>.yaml
--force Optional. If provided, nodes will be forcefully removed from the cluster without running reset jobs.
--gcr-service-account-key string Optional, path to the service account json key to pull gcr images. Mutually exclusive with --cluster flag. If not provided, the environment variable GOOGLE_APPLICATION_CREDENTIALS will be used.
-h, --help help for nodes
--ignore-validation-errors A validation error override, allowing to proceed despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
--login-user string login user to use to connect to the nodes. Mutually exclusive with --cluster flag. Optional and should be used together with --ssh-private-key-path. Default to root.
--registry-mirror-ca string Registry mirror CA file.
--registry-mirror-credential string Registry mirror credential file.
--registry-mirror-endpoint string Registry mirror endpoint.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--ssh-private-key-path string path to the ssh private key to connect to the nodes. Either --cluster or --ssh-private-key-path should be provided, but not both. Use this flag to reset the machines if the original cluster yaml is no longer available.
Para mais informações sobre como usar bmctl reset nodes
para retornar nós de cluster ao
estado de pré-instalação ou exclusão de clusters, consulte
Redefinir um nó com falha no Google Distributed Cloud.
restore
Restaurar um cluster ou tentar recuperar o quórum para um cluster.
Sinopse
Restaure um cluster. Quando usado sem o subcomando de cluster, este comando tenta restaurar um cluster de alta disponibilidade de uma perda de quórum. Quando usado com o subcomando cluster, o comando restaura um cluster de um arquivo de backup.
restore [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be
placed under
<workspace dir>/<cluster name>/<cluster name>.yaml
--control-plane-node string IP for the surviving host address, should be a
single IP address(e.g., 192.168.0.1).
-h, --help help for restore
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string kubeconfig file path for the management cluster. This
only needs to be provided if restoring a broken user
cluster.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
restaurar cluster
Restaure um cluster de um arquivo de backup.
restore cluster [flags]
Opções
--backup-file string path to the backup file of the cluster.
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string path to the kubeconfig of the management cluster.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--use-disk Perform the restore using the disk instead of
in-memory buffer. This option only works when the
command is run by the root user or with sudo.
Para mais informações sobre como fazer backup e restaurar clusters com bmctl
, consulte
Fazer backup e restaurar clusters com o bmctl.
update
Atualizar recursos do cluster.
Opções
-h, --help help for update
Atualizar cluster
Atualizar configurações de cluster e pool de nós. Esse comando aplica as alterações feitas no arquivo de configuração do cluster. Por padrão, o arquivo de configuração <cluster_name>.yaml
é armazenado na pasta bmctl-workspace/<cluster_name>/
na estação de trabalho de administrador.
update cluster [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
Para mais informações sobre a atualização de clusters com bmctl
, consulte Atualizar clusters. Para ver quais arquivos de configuração de cluster são mutáveis, consulte a referência do campo de configuração do cluster.
Atualizar credenciais
Atualizar as credenciais do cluster
Sinopse
Atualizar as credenciais dos clusters. Este comando atualiza as credenciais do cluster de administrador e as credenciais dos clusters de usuário gerenciados pelo cluster de administrador.
update credentials [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
--cloud-operations-service-account-key-path string New credential: path to cloud operations
service account key.
-c, --cluster cluster name Cluster name, cluster config is expected
to be placed under
<workspace dir>/<cluster name>/<cluster name>.yaml
--gcr-key-path string New credential: path to GCR service
account key.
--gke-connect-agent-service-account-key-path string New credential: path to gke connect
agent service account key.
--gke-connect-register-service-account-key-path string New credential: path to gke connect
register service account key.
-h, --help help for credentials
--ignore-validation-errors A validation error override, allowing
to proceed despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file
for the admin cluster. IF not provided,
will fall back to read env var
ANTHOS_ADMIN_KUBECONFIG.
--node-agent-client-cert-path string New credential: path to Node Agent
client certificates.
--node-agent-client-private-key-path string New credential: path to Node Agent
client private key.
--node-agent-server-ca-path string New credential: path to Node Agent
server CA.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--ssh-private-key-path string New credential: path to ssh private key.
atualizar credenciais autoridades certificado
Atualizar autoridades de certificação em clusters.
Opções
-h, --help help for certificate-authorities
Opções herdadas de comandos pai
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
atualizar credenciais credenciais certificado alternar
Rotacionar autoridades certificadoras
update credentials certificate-authorities rotate [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
--cluster-ca-cert-path string New credential: path to custom cluster CA certificate.
--cluster-ca-private-key-path string New credential: path to custom cluster CA private key.
--etcd-ca-cert-path string New credential: path to custom etcd CA certificate.
--etcd-ca-private-key-path string New credential: path to custom etcd CA private key.
--front-proxy-ca-cert-path string New credential: path to custom front proxy CA
certificate.
--front-proxy-ca-private-key-path string New credential: path to custom front proxy CA private
key.
-h, --help help for rotate
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
````
#### Options inherited from parent commands
```none
--kubeconfig string Optional, path to the kubeconfig file for the admin cluster. IF not
provided, will fall back to read env var ANTHOS_ADMIN_KUBECONFIG.
fazer upgrade
Faça upgrade de um cluster no local para uma nova versão.
Opções
-h, --help help for upgrade
fazer upgrade do cluster
Fazer upgrade de um cluster.
Sinopse
Fazer upgrade de um cluster. Esse comando lê a versão de destino do arquivo de configuração do cluster e atualiza o cluster de destino para a versão especificada. Todas as outras alterações no arquivo de configuração do cluster são ignoradas. O comando requer a permissão serviceusage.services.get
para verificar a ativação da API no projeto Google Cloud especificado no arquivo de configuração.
upgrade cluster [flags]
Opções
--bootstrap-cluster-pod-cidr string Bootstrap cluster pod CIDR (default
"192.168.122.0/24")
--bootstrap-cluster-service-cidr string Bootstrap cluster service CIDR (default
"10.96.0.0/27")
-c, --cluster cluster name Cluster name, cluster config is expected to be placed
under
<workspace dir>/<cluster name>/<cluster name>.yaml
--cluster-update-timeout duration Cluster update timeout, default value is 24h. The
input should contain the duration unit, e.g. 3600s,
60m or 1h. (default 24h0m0s)
--force If true, ignore errors from preflight checks.
-h, --help help for cluster
--ignore-validation-errors A validation error override, allowing to proceed
despite the validation errors.
--kubeconfig string Optional, path to the kubeconfig file for the admin
cluster. IF not provided, will fall back to read env
var ANTHOS_ADMIN_KUBECONFIG.
--reuse-bootstrap-cluster If true, use existing bootstrap cluster.
--skip-bootstrap-cidr-check If true, skip checking CIDR and the number of nodes
to determine whether upgrade would succeed.
--skip-preflight If true, skip standalone preflight checks.
upgrade intermediate-version
Imprime a versão intermediária para a qual o cluster será atualizado primeiro ao realizar um upgrade que pula uma versão secundária.
Sinopse
Imprime a versão intermediária para a qual o cluster será atualizado primeiro ao realizar um upgrade que pula uma versão secundária.
Com a opção "Pular upgrade da versão secundária", é possível fazer upgrade de um cluster em duas versões secundárias. Um cluster na versão 1.31.x que está sendo atualizado para a 1.33.z vai seguir o caminho de upgrade 1.31.x -> 1.32.y -> 1.33.z, em que 1.32.y é a versão intermediária.
upgrade intermediate-version [flags]
Opções
-h, --help help for intermediate-version
Para mais informações sobre upgrades de cluster, consulte a seguinte documentação:
- Fazer upgrade de clusters
- Práticas recomendadas para upgrades de cluster do Google Distributed Cloud
- Ciclo de vida e etapas dos upgrades de cluster
version
Imprimir a versão do bmctl
version [flags]
Opções
-h, --help help for version
-o, --output string Output format of version string. Supported options: [version, commit,
metadata-digest]