מאמרי עזרה על פקודות bmctl

bmctl הוא כלי שורת פקודה ל-Google Distributed Cloud שמפשט את יצירת האשכולות וניהולם. במסמך הזה מפורטות כל הפקודות של bmctl והדגלים שקשורים אליהן.

לפני שמתחילים

bmctl משתמש בפרטי הכניסה ב-Application Default Credentials ‏ (ADC) כדי לאמת את הערך של location במפרט האשכול (clusterOperations.location) כשהוא לא מוגדר ל-global. האימות הזה נדרש עבור הרבה פקודות של bmctl. כדי ש-ADC יפעל, צריך לבצע אחת מהפעולות הבאות:

  • מגדירים את משתנה הסביבה GOOGLE_APPLICATION_CREDENTIALS בתחנת העבודה של האדמין לנתיב של קובץ פרטי הכניסה של חשבון השירות.

  • שימוש בפרטי הכניסה של המשתמש כ-Application Default Credentials (ADC) באמצעות ה-CLI של gcloud:

    gcloud auth application-default login
    

חלק מהפקודות של bmctl מאפשרות לציין נתיב לקובץ פרטי כניסה באמצעות דגל.

גיבוי

גיבוי של פרטי האשכול.

אפשרויות

  -h, --help   help for backup

מקבץ גיבוי

מגבים אשכול ושומרים את הגיבוי בקובץ tar.

backup cluster [flags]

אפשרויות

      --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).

למידע נוסף על גיבוי ושחזור של אשכולות באמצעות bmctl, אפשר לעיין במאמר גיבוי ושחזור של אשכולות באמצעות bmctl.

check

מבצעים בדיקות קדם הפעלה או בדיקות תקינות באשכולות או בתשתית.

אפשרויות

  -h, --help   help for check

בדיקת תוספים

בדיקת התקינות התפעולית של תוספים לאשכולות, כמו stackdriver-log-aggregator, stackdriver-log-forwarder ו-gke-connect-agent.

check add-ons [flags]

דוגמאות

# Do a health check for add-ons.
bmctl check add-ons --cluster=cluster1

אפשרויות

      --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.

בדיקת אשכול

בודקים את תקינות האשכול או יוצרים תמונת מצב של האשכול.

check cluster [flags]

דוגמאות

# 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

אפשרויות

      --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 that 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 that 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 a snapshot to ensure that they are read-only. Commands that are 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 that 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 log in to each node. This will be ignored when admin-kubeconfig is set. (default "root")
      --node-ssh-key string                         The file that contains the 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 the --snapshot-config and --num-of-parallel-threads flags cannot be used at the same time. (default 10)
      --quiet                                       During a snapshot run, suppress logging to stdout. (The console log is available in the 'bmctl_diagnose_snapshot.log' file, which is 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 the "--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 through 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 the --enforce_allowlist=false option. Note that the --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 the --config flag is specified. The supported scenarios are:
                                                    - system: a snapshot of system components, including their logs
                                                    - all: a snapshot of all pods, including their logs (default "system")
      --snapshot-temp-output-dir string             The temporary landing directory for the 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). 

check config

בודקים את קובץ התצורה של האשכול.

check config [flags]

דוגמאות

# Do check for cluster1.yaml file.
bmctl check config --cluster=cluster1

אפשרויות

      --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.

check gcp

קישוריות של אשכול לבדיקת תקינות ב-Google Cloud.

check gcp [flags]

דוגמאות

# Do a Google Cloud connectivity health check for cluster machines.
bmctl check gcp --cluster=cluster1

אפשרויות

      --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.

check kubernetes

בדיקת התקינות של Kubernetes.

check kubernetes [flags]

דוגמאות

# Do a Kubernetes health check for the cluster.
bmctl check kubernetes --cluster=cluster1

אפשרויות

      --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.

בדיקת הצמתים

בודקים את התקינות של הצמתים.

check nodes [flags]

דוגמאות

# Do a health check for some provisioned nodes.
bmctl check nodes --addresses=192.168.0.1,192.168.0.4

אפשרויות

      --addresses strings                       Node addresses; addresses should be a comma-separated list, and each address must 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.

בדיקת קדם-הפעלה

בדיקת קדם-הפעלה.

תקציר

בדיקת קדם-הפעלה להתקנה ושדרוג של אשכול. כדי להריץ בדיקה מקדימה לשדרוג, מעבירים את --kubeconfig <admin_cluster_kubeconfig_path> ומעדכנים את הגרסה בקובץ ה-YAML של האשכול.

check preflight [flags]

דוגמאות

# 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 and cluster1's spec version is updated, the command will trigger a preflight check for upgrading 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 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

VM Runtime לבדיקה מקדימה של GDC.

תקציר

בדיקת קדם הפעלה של זמן הריצה של מכונת VM כדי לבדוק את התנאים המוקדמים ליצירת מכונת VM.

check vmruntimepfc [flags]

דוגמאות

# Do vmruntime preflight check.
bmctl check vmruntimepfc --kubeconfig=$KUBECONFIG

אפשרויות

  -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.

מידע נוסף על בדיקות קדם-הפעלה זמין במאמר הסבר על בדיקות קדם-הפעלה.

להגדיר

מגדירים חשבונות שירות ותפקידי IAM ומפעילים ממשקי API ב-Google Cloud לאימות אשכולות של Workload Identity.

אפשרויות

  -h, --help   help for configure

הגדרת פרויקטים

הגדרת קישורי מדיניות IAM לאימות של עומסי עבודה באשכול. יוצר את חשבונות השירות הנדרשים ומפעיל את ממשקי ה-API הנדרשים.

configure projects [flags]

אפשרויות

      --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

מידע נוסף על הפעלה ושימוש באימות של עומסי עבודה באשכול זמין במאמר אימות של עומסי עבודה באשכול.

create

יוצרים קובץ תצורה של אשכול, אשכול או חשבון שירות של Kubernetes‏ (KSA).

אפשרויות

  -h, --help   help for create

יצירת אשכול

יוצרים אשכול מקובץ תצורת אשכול.

תקציר

יוצרים אשכול. הפקודה הזו תפיק kubeconfig של האשכול שנוצר. חשוב לשמור את הקובץ הזה במקום בטוח, כי הוא מכיל את פרטי הכניסה של האשכול. כדי להריץ את הפקודה הזו, צריך לתת ל-serviceusage.services.get הרשאה לבדוק אם ממשקי ה-API מופעלים בפרויקט בענן שלכם ב-Google Cloud.

create cluster [flags]

אפשרויות

      --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 GCP 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.

מידע נוסף על יצירת אשכולות זמין במאמר סקירה כללית על יצירת אשכולות.

יצירת קובץ הגדרה

יוצרים קובץ תצורה של אשכול. כברירת מחדל, הקובץ הזה נוצר בתיקייה bmctl-workspace/&lt;cluster_name>.

create config [flags]

אפשרויות

      --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                 Automatically create GCP service account keys, if they do not already exist in the workspace
      --enable-apis                             Automatically enable APIs used by Anthos clusters on bare metal for the GCP project specified by the 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 the HTTPS_PROXY and HTTP_PROXY environment variables
      --reuse-bootstrap-cluster                 If true, use existing bootstrap cluster.

create ksa

יוצרים חשבון שירות של Kubernetes עם התפקיד cluster-admin באשכול היעד. שם חשבון השירות של Kubernetes שמוגדר כברירת מחדל הוא kubernetes-service-account, ולכן השימוש בדגל --ksa-name הוא אופציונלי. הפקודה יוצרת אסימון bearer שאפשר להשתמש בו כדי להתחבר לאשכול. כברירת מחדל, טוקן ה-bearer מאוחסן בתיקייה bmctl-workspace/&lt;cluster_name>.

create ksa [flags]

אפשרויות

  -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.

disable

השבתה של VM Runtime ל-GDC באשכול.

אפשרויות

  -h, --help   help for disable

disable vmruntime

השבתה של VM Runtime ל-GDC באשכול.

disable vmruntime [flags]

אפשרויות

      --force               If true, delete all VM resources and disable VM Runtime.
  -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.

מידע נוסף על הפעלה והשבתה של VM Runtime ב-GDC זמין במאמר הפעלה או השבתה של VM Runtime ב-GDC.

enable

מפעילים את VM Runtime for GDC באשכול.

אפשרויות

  -h, --help   help for enable

enable vmruntime

מפעילים את VM Runtime for GDC באשכול.

enable vmruntime [flags]

אפשרויות

 -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.

מידע נוסף על הפעלה והשבתה של VM Runtime ב-GDC זמין במאמר הפעלה או השבתה של VM Runtime ב-GDC.

get

אחזור של הגדרת אשכול או פרטי כניסה לאשכול.

אפשרויות

  -h, --help   help for get

get config

מאחזרים את קובץ התצורה של האשכול. הפקודה שולפת את המשאבים המותאמים אישית של אשכול היעד ומפיקה קובץ תצורה.

get config [flags]

אפשרויות

  -c, --cluster string      Cluster name; the 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.

מידע נוסף זמין במאמר קבלת פרטים על הגדרת האשכול.

קבלת פרטי כניסה

מקבלים את פרטי הכניסה של אשכול היעד. הפקודה יוצרת קובץ kubeconfig בתיקייה <workspace dir>/<cluster name> בתחנת העבודה של האדמין.

get credentials [flags]

אפשרויות

  -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.

למידע נוסף, ראו קבלת פרטי כניסה לאשכול.

התקנה

מבצע פעולות של התקנת תוכנה.

אפשרויות

  -h, --help   help for install

התקנת virtctl

מתקינים את virtctl במכונה הנוכחית כפלאגין kubectl. תוסף virtctl תומך בפעולות בסיסיות של מכונות וירטואליות, כמו יצירה, חיבור ושינוי מצב ההפעלה.

install virtctl [flags]

אפשרויות

  -d, --dst-dir string   The dir virtctl binary to be installed. This path must be a valid one within the PATH env variable.
  -h, --help             help for virtctl

move

העברה של משאבים ב-Google Distributed Cloud וכל יחסי התלות בין אשכולות ניהול.

  • מרחב השמות של אשכול היעד יכול להכיל משאבים נוספים, ומשאבים שמתנגשים מוחלפים.
move [flags]

אפשרויות

      --cluster-move-timeout duration    Cluster move timeout; the 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, the default discovered kubeconfig will be used.
      --from-kubeconfig-context string   Context to be used within the kubeconfig file for the source management cluster. If empty, the 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, the current context will be used.

nodeagent

ניהול הפריסה של Node Agent.

תקציר

השירות מספק פקודות לניהול שירות Node Agent בצמתים של אשכול.

אפשרויות

  -h, --help   help for nodeagent

nodeagent deploy

פורסים באמצעות SSH את שירות סוכן הצומת בצמתים שצוינו.

תקציר

פורסים את שירות Node Agent בצומת יעד אחד או יותר באשכול מוגדר באמצעות SSH.

הפקודה הזו יכולה להתקין או להתקין מחדש את Node Agent. הוא מתחבר דרך SSH ומבצע את השלבים הנדרשים, כולל העברת קבצים בינאריים, יצירה והעברה של אישורים (אופציונלי) והגדרת שירות systemd.

נדרשת גישת SSH והרשאות sudo בצמתי היעד.

הפקודה הזו מטפלת גם בהגדרה הראשונית של סוכן Node וגם בשחזור שלו.

אפשר לציין את צמתי היעד בכמה דרכים: ישירות באמצעות הדגל --nodes, דרך קובץ תצורת האשכול באמצעות הדגל --cluster, או על ידי הפניה למשאב המותאם אישית של האשכול.

nodeagent deploy [flags]

אפשרויות

      --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 the necessary CAs and client credentials for the Node Agent.
  -h, --help                       help for deploy
      --key-algorithm string       The private key algorithm for the CA, client certificate, 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

הפעלת מצב Node Agent באשכול הפועל.

תקציר

הפעלת מצב Agent באשכול.

הפקודה הזו משנה את ההגדרה של האשכול וגם יוצרת או מעדכנת את פרטי הכניסה שקשורים למצב הזה ונדרשים כדי שהוא יפעל.

כשמצב Node Agent פעיל, ניהול האשכול מתבצע על ידי Node Agent שפועל ישירות בכל צומת.

nodeagent enable [flags]

אפשרויות

      --client-ca-key-path string   Path for the client private key file.
      --client-ca-path string       Path for the client CA certificate file.
      --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).
      --ensure-status               Ensure the Node Agent is running on all nodes 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

מבצע רוטציה של פרטי הכניסה של Node Agent בצמתים שצוינו באמצעות SSH ובתוך האשכול.

תקציר

מבצעת רוטציה של פרטי הכניסה nodeagentd בצומת יעד אחד או יותר באמצעות SSH. הפקודה הזו מעדכנת גם את פרטי הכניסה המתאימים של Node Agent שמאוחסנים באשכול.

הפקודה הזו יכולה לסובב את פרטי הכניסה של Node Agent. נדרשת גישת SSH והרשאות sudo בצמתי היעד.

אפשר לציין את צמתי היעד בכמה דרכים: ישירות באמצעות הדגל --nodes, דרך קובץ תצורת האשכול באמצעות הדגל --cluster, או על ידי הפניה למשאב המותאם אישית של האשכול.

nodeagent rotate-credentials [flags]

אפשרויות

      --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")

סטטוס של nodeagent

בודקים את סטטוס ההפעלה של Node Agent בצמתי האשכול.

תקציר

בודקים את סטטוס ההפעלה של Node Agent בצמתי האשכול.

אפשר לציין את צמתי היעד בכמה דרכים: ישירות באמצעות הדגל --nodes, דרך קובץ תצורת האשכול באמצעות הדגל --cluster, או על ידי הפניה למשאב המותאם אישית של האשכול.

nodeagent status [flags]

אפשרויות

      --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.

דחיפת הודעות

העלאה של תמונות קונטיינרים למאגר פרטי.

אפשרויות

  -h, --help   help for push

דחיפת תמונות

העברה בדחיפה של קובץ tar של קובצי אימג' מקומיים של קונטיינרים למאגר פרטי.

push images [flags]

אפשרויות

      --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.

מידע על הגדרה ושימוש במראה של מאגר לקובצי אימג' של קונטיינרים ב-Bare Metal זמין במאמר שימוש במראה של מאגר לקובצי אימג' של קונטיינרים.

להירשם

רישום משאבים.

אפשרויות

  -h, --help   help for register

register bootstrap

רושמים את אשכול האתחול ב-GKE Hub API.

תקציר

רושמים את אשכול האתחול ב-GKE Hub API. הפקודה הזו רושמת אשכול Kind מקומי כאשכול אדמין. הפקודה ממתינה ליצירת אשכול במסוף Google Cloud, ויוצאת אחרי שהאשכול נוצר בהצלחה.

register bootstrap [flags]

אפשרויות

      --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 Anthos 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 GCR 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.

אפס

איפוס המכונות באשכול למצב שלפני ההתקנה.

תקציר

הפקודה הזו מנסה לבטל שינויים שבוצעו בניסיונות התקנה קודמים. זהו ניסיון שחזור שנעשה כמיטב היכולת, והוא נועד לשחזור אחרי כשלים בהתקנה חלקית.

reset [flags]

אפשרויות

      --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.

איפוס bootstrap

מוחקים את אשכול ה-bootstrap.

דוגמאות

bmctl reset bootstrap

אפשרויות

  -h, --help   help for bootstrap

איפוס הצמתים

איפוס של צמתים ספציפיים באשכול למצב שלפני ההתקנה על ידי הסרתם מהאשכול. במקרים שבהם אין גישה לצמתים, אפשר להשתמש באפשרות --force כדי לדלג על שלב האיפוס. אם אין גישה למישור הבקרה של האשכול, אפשר להשתמש באפשרויות --ssh-private-key-path, ‏ --login-user ו---gcr-service-account-key כדי לאפס את הצמתים שצוינו למצב שלפני ההתקנה, בלי למחוק אותם מהאשכול.

דוגמאות

bmctl reset nodes --addresses 10.200.0.10,10.200.0.11 --cluster cluster1 --kubeconfig admin-kubeconfig

אפשרויות

      --addresses strings                       Node addresses; the addresses should be a comma-separated list, and each address must 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 the --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 the --cluster flag. Optional, and should be used together with --ssh-private-key-path. Defaults 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.

מידע נוסף על שימוש ב-bmctl reset nodes כדי להחזיר צמתים של אשכול למצב שלפני ההתקנה או כדי למחוק אשכולות זמין במאמר איפוס של צומת שנכשל ב-Google Distributed Cloud.

לבטל השעיה

לשחזר אשכול או לנסות להשיג שוב את הקוורום של האשכול.

תקציר

שחזור אשכול. כשמשתמשים בפקודה הזו בלי פקודת המשנה cluster, המערכת מנסה לשחזר אשכול בזמינות גבוהה מאובדן קוורום. כשמשתמשים בפקודה עם פקודת המשנה cluster, הפקודה משחזרת אשכול מקובץ גיבוי.

restore [flags]

אפשרויות

      --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.

שחזור אשכול

שחזור אשכול מקובץ גיבוי.

restore cluster [flags]

אפשרויות

      --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.

למידע נוסף על גיבוי ושחזור של אשכולות באמצעות bmctl, אפשר לעיין במאמר גיבוי ושחזור של אשכולות באמצעות bmctl.

update

עדכון משאבי האשכול.

אפשרויות

  -h, --help   help for update

עדכון אשכול

עדכון ההגדרות של האשכול ומאגר הצמתים. הפקודה הזו מחילה את השינויים שבוצעו בקובץ התצורה של האשכול. כברירת מחדל, קובץ התצורה <cluster_name>.yaml מאוחסן בתיקייה bmctl-workspace/<cluster_name>/ בתחנת העבודה של האדמין.

update cluster [flags]

אפשרויות

      --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.

מידע נוסף על עדכון אשכולות באמצעות bmctl זמין במאמר בנושא עדכון אשכולות. כדי לראות אילו קובצי תצורה של אשכול ניתנים לשינוי, אפשר לעיין בחומר עזר בנושא שדות תצורה של אשכול.

עדכון פרטי הכניסה

עדכון פרטי הכניסה לאשכול.

תקציר

עדכון פרטי הכניסה של אשכולות. הפקודה הזו מעדכנת את פרטי הכניסה של אשכול האדמין ואת פרטי הכניסה של אשכולות המשתמשים שמנוהלים על ידי אשכול האדמין.

update credentials [flags]

אפשרויות

      --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 the 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 the GCR service account key.
      --gke-connect-agent-service-account-key-path string      New credential: path to the GKE Connect agent service account key.
      --gke-connect-register-service-account-key-path string   New credential: path to the 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 the Node Agent client certificates.
      --node-agent-client-private-key-path string              New credential: path to the Node Agent client private key.
      --node-agent-server-ca-path string                       New credential: path to the Node Agent server CA.
      --reuse-bootstrap-cluster                                If true, use existing bootstrap cluster.
      --ssh-private-key-path string                            New credential: path to the SSH private key.

‫update credentials certificate-authorities

עדכון רשויות אישורים באשכולות.

אפשרויות

  -h, --help   help for certificate-authorities

אפשרויות שעוברות בירושה מהפקודות ברמת ההורה

      --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.

update credentials certificate-authorities rotate

החלפת רשויות אישורים.

update credentials certificate-authorities rotate [flags]

אפשרויות

      --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 the custom cluster CA certificate.
      --cluster-ca-private-key-path string       New credential: path to the custom cluster CA private key.
      --etcd-ca-cert-path string                 New credential: path to the custom etcd CA certificate.
      --etcd-ca-private-key-path string          New credential: path to the custom etcd CA private key.
      --front-proxy-ca-cert-path string          New credential: path to the custom front proxy CA certificate.
      --front-proxy-ca-private-key-path string   New credential: path to the 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.

שדרוג

שדרוג אשכול במקום לגרסה חדשה.

אפשרויות

  -h, --help   help for upgrade

שדרוג האשכול

שדרוג אשכול.

תקציר

שדרוג אשכול. הפקודה הזו קוראת את גרסת היעד מקובץ התצורה של האשכול ומשדרגת את אשכול היעד לגרסה שצוינה. המערכת מתעלמת מכל השינויים האחרים בקובץ התצורה של האשכול. הפקודה דורשת הרשאה serviceusage.services.get כדי לבדוק את הפעלת ה-API בפרויקט Google Cloud שצוין בקובץ ההגדרות.

upgrade cluster [flags]

אפשרויות

      --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; the 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 the CIDR and the number of nodes to determine whether the upgrade would succeed.
      --skip-paused-annotation-check            If true, continue the upgrade even if the cluster is paused by skipping the paused annotation check.
      --skip-preflight                          If true, skip standalone preflight checks.

upgrade intermediate-version

מדפיסים את גרסת הביניים שאליה האשכול ישודרג קודם כשמבצעים שדרוג של דילוג על גרסה משנית.

תקציר

מדפיסים את גרסת הביניים שאליה האשכול ישודרג קודם כשמבצעים שדרוג של דילוג על גרסה משנית.

שדרוג של גרסה משנית מאפשר לשדרג אשכול בשתי גרסאות משניות. אם משדרגים אשכול בגרסה 1.31.x לגרסה 1.33.z, נתיב השדרוג יהיה 1.31.x -> 1.32.y -> 1.33.z, כאשר 1.32.y היא גרסת הביניים.

upgrade intermediate-version [flags]

אפשרויות

  -h, --help   help for intermediate-version

מידע נוסף על שדרוגים של אשכולות זמין במאמרי העזרה הבאים:

גרסה

הדפסת גרסת bmctl

version [flags]

אפשרויות

  -h, --help            help for version
  -o, --output string   Output format of version string. Supported options: [version, commit, metadata-digest]
  -t, --timestamps      Prefix each line with a timestamp. This will be removed in future releases.