AMC is the command-line tool for ACK One Fleet. This topic covers download and installation, key capabilities, and how to get command-line help.
AMC is a kubectl plug-in for Distributed Cloud Container Platform for Kubernetes (ACK One). With AMC, you can:
-
Use AMC like kubectl
-
Manage Deployments, Services, and Ingresses across Fleet-managed clusters
-
Query Kubernetes resource status (Pods, Services) in one or all managed clusters
-
View task logs for workloads scheduled to a managed cluster
-
Inspect application topology and resource status across clusters
Prerequisites
Ensure that you have:
-
An ACK One Fleet instance with at least one associated cluster
-
The kubeconfig file of the Fleet instance
-
wget(Linux) orcurl(macOS) installed
Install AMC
Download the AMC binary, make it executable, and move it to /usr/local/bin.
Linux
| Architecture | Command |
|---|---|
| amd64 | wget http://ack-one.oss-cn-hangzhou.aliyuncs.com/kubectl-amc-linux-amd64 && chmod +x kubectl-amc-linux-amd64 && mv kubectl-amc-linux-amd64 /usr/local/bin/kubectl-amc |
| arm64 | wget http://ack-one.oss-cn-hangzhou.aliyuncs.com/kubectl-amc-linux-arm64 && chmod +x kubectl-amc-linux-arm64 && mv kubectl-amc-linux-arm64 /usr/local/bin/kubectl-amc |
macOS
| Architecture | Command |
|---|---|
| amd64 | curl -LO http://ack-one.oss-cn-hangzhou.aliyuncs.com/kubectl-amc-mac-amd64 && chmod +x kubectl-amc-mac-amd64 && mv kubectl-amc-mac-amd64 /usr/local/bin/kubectl-amc |
| arm64 | curl -LO http://ack-one.oss-cn-hangzhou.aliyuncs.com/kubectl-amc-mac-arm64 && chmod +x kubectl-amc-mac-arm64 && mv kubectl-amc-mac-arm64 /usr/local/bin/kubectl-amc |
Verify the installation
Run kubectl amc -h to verify AMC is installed:
kubectl amc -h
List managed clusters and aliases
Run kubectl amc get managedcluster to list all clusters and their aliases:
kubectl amc get managedcluster
Expected output:
Name Alias HubAccepted
managedcluster-c**** cluster1 true
managedcluster-c**** cluster2 true
managedcluster-c**** cluster3 true
Clusters previously associated with ACK One return none in the Alias column.
Set a cluster alias
To set a cluster alias:
kubectl annotate managedcluster <managedcluster name> ackone.aliyun.com/cluster-alias=<cluster-alias>
To update an alias, add --overwrite:
kubectl annotate managedcluster <managedcluster name> ackone.aliyun.com/cluster-alias=<cluster-alias> --overwrite
Query resources in a managed cluster
Use -m to target a specific cluster, or -m all to query all clusters.
| Flag | Description |
|---|---|
-n <namespace> |
Namespace to query |
-m <cluster-name> |
Managed cluster name. Use all for all clusters. |
Query a specific cluster
kubectl amc get deployment -n demo -m managedcluster-c****
Replace managedcluster-c**** with your cluster name.
Expected output:
Run on ManagedCluster managedcluster-c**** (cluster-alias-****)
NAME READY UP-TO-DATE AVAILABLE AGE
web-demo 1/1 1 1 42h
Query all clusters
kubectl amc get deployment -n demo -m all
Expected output:
Run on ManagedCluster managedcluster-c**** (cluster1)
NAME READY UP-TO-DATE AVAILABLE AGE
web-demo 1/1 1 1 42h
Run on ManagedCluster managedcluster-c**** (cluster2)
NAME READY UP-TO-DATE AVAILABLE AGE
web-demo 3/3 3 3 42h
Run on ManagedCluster managedcluster-c**** (cluster3)
NAME READY UP-TO-DATE AVAILABLE AGE
web-demo 5/5 5 5 42h
Inspect application topology
Use appstatus with --tree and --detail to display an application's topology and resource status across clusters.
| Flag | Description |
|---|---|
--tree |
Show resources in a tree with parent-child relationships |
--detail |
Show detailed status for each resource |
kubectl amc appstatus demo -n demo --tree --detail
Expected output:
CLUSTER NAMESPACE RESOURCE STATUS APPLY_TIME DETAIL
managedcluster-c****─── demo ─┬─ Deployment/demo updated 2022-05-27 06:48:13 Ready: 4/4 Up-to-date: 4 Available: 4 Age: 8m2s
├─ Ingress/demo updated 2022-05-27 06:48:13 Class: <none> Hosts: app.demo.example.com Address:
│ Ports: 80 Age: 8m2s
├─ ConfigMap/demo updated 2022-05-27 14:48:13 Data: 4 Age: 8m2s
└─ Service/demo updated 2022-05-27 06:48:13 Type: ClusterIP Cluster-IP: 192.168.9.178
External-IP: <none> Port(s): 82/TCP Age: 8m2s
managedcluster-c****─── demo ─┬─ Deployment/demo updated 2022-05-27 06:48:16 Ready: 2/2 Up-to-date: 2 Available: 2 Age: 7m59s
├─ Ingress/demo updated 2022-05-27 06:48:15 Class: <none> Hosts: app.demo.example.com Address:
│ Ports: 80 Age: 7m59s
├─ ConfigMap/demo updated 2022-05-27 14:48:17 Data: 4 Age: 7m58s
└─ Service/demo updated 2022-05-27 06:48:15 Type: ClusterIP Cluster-IP: 192.168.199.111
External-IP: <none> Port(s): 82/TCP Age: 7m59s