This page explains how to inspect existing stateless workloads running in a Google Distributed Cloud (GDC) air-gapped appliance Kubernetes cluster. Stateless workloads let you run your application deployment without having to store data or application state. You can view your stateless workloads with the GDC console or the kubectl CLI to monitor resource usage and workload health.
This page is for developers within the application operator group, who are responsible for managing application workloads for their organization.
Before you begin
To run commands against the pre-configured bare metal Kubernetes cluster, make sure you have the following resources:
Locate the Kubernetes cluster name, or ask your Platform Administrator what the cluster name is.
Sign in and generate the kubeconfig file for the Kubernetes cluster if you don't have one.
Use the kubeconfig path of the Kubernetes cluster to replace
CLUSTER_KUBECONFIG
in these instructions.
To get the required permissions to view all workloads deployed in a project, ask
your Organization IAM Admin to grant you the Workload Viewer role
(workload-viewer
) in your project namespace.
To get the required permissions to inspect stateless workloads, ask your
Organization IAM Admin to grant you the Namespace Admin role (namespace-admin
)
in your project namespace.
View a project's container workloads
Run the following command to list all pods in your project:
kubectl get pods -n PROJECT_NAMESPACE
The output is similar to the following:
NAME READY STATUS RESTARTS AGE
nginx-workload-ah-aa-1228 1/1 Running 0 12h
nginx-workload-ah-ab-6784 1/1 Running 0 11h
nginx-workload-ah-ac-0045 1/1 Running 0 12h
Inspect the deployment
To request more detailed information about the components of a Deployment
resource, run commands that directly target the entity you're looking to
inspect.
Get Deployment
object information
To get detailed information about the Deployment
object, run:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n NAMESPACE \
describe deployment DEPLOYMENT_NAME
Replace the following:
CLUSTER_KUBECONFIG
: the kubeconfig file for the Kubernetes cluster running the deployment.NAMESPACE
: the project namespace.DEPLOYMENT_NAME
: the name of theDeployment
object.
Display live configuration in YAML format
To view a Deployment
object's manifest, run:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n NAMESPACE \
get deployments DEPLOYMENT_NAME -o yaml
This command displays the Deployment
object's live configuration in YAML
format.
List pods
To list the Pod
objects created by the deployment, run:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n NAMESPACE \
get pods -l KEY=VALUE
In this command, the -l
flag lists all Pod
objects with the specified
key-value pair label.
Replace the following:
CLUSTER_KUBECONFIG
: the kubeconfig file for the Kubernetes cluster running the deployment.NAMESPACE
: the project namespace.KEY
: the key for the key-value pair label set in the deployment. For example, if the.template.metadata.labels
field has theapp: myapp
label configured, the key isapp
.VALUE
: the value for the key-value pair label set in the deployment. For example, if the.template.metadata.labels
field has theapp: myapp
label configured, the value ismy-app
.
For example, if you labeled the Deployment
object app: my-app
, you'd run the
following command to see Pod
objects with that label:
kubectl --kubeconfig /tmp/kubeconfig.yaml -n my-namespace \
get pods -l app=my-app
Get specific pod information
To get information about a specific Pod
object, run:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n NAMESPACE \
describe pod POD_NAME
Replace the following:
CLUSTER_KUBECONFIG
: the kubeconfig file for the Kubernetes cluster running the deployment.NAMESPACE
: the project namespace.POD_NAME
: the name of the pod managed by the deployment.