Inspect stateless workloads

After you create a Deployment object, you can request information about it and its managed resources.

Before you begin

To run commands against a user cluster, ensure you have the following resources:

  1. Locate the user cluster name, or ask your Platform Administrator what the cluster name is.

  2. Sign in and generate the kubeconfig file for the user cluster if you don't have one.

  3. Use the kubeconfig path of the user cluster to replace USER_CLUSTER_KUBECONFIG in these instructions.

To get the required permissions to inspect stateless workloads, ask your Organization IAM Admin to grant you the Namespace Admin role.

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 USER_CLUSTER_KUBECONFIG \
    describe deployment DEPLOYMENT_NAME

Replace the following:

  • USER_CLUSTER_KUBECONFIG: the kubeconfig file for the user cluster running the deployment.

  • DEPLOYMENT_NAME: the name of the Deployment object.

Display live configuration in YAML format

To view a Deployment object's manifest, run:

kubectl --kubeconfig USER_CLUSTER_KUBECONFIG \
    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 USER_CLUSTER_KUBECONFIG \
    get pods -l KEY=VALUE

In this command, the -l flag lists all Pod objects with the specified key-value pair label in the specified user cluster.

Replace the following:

  • USER_CLUSTER_KUBECONFIG: the kubeconfig file for the user cluster running the deployment.

  • KEY: the key for the key-value pair label set in the deployment. For example, if the .template.metadata.labels field has the app: myapp label configured, the key is app.

  • VALUE: the value for the key-value pair label set in the deployment. For example, if the .template.metadata.labels field has the app: myapp label configured, the value is my-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 get pods -l app=my-app

Get specific pod information

To get information about a specific Pod object, run:

kubectl --kubeconfig USER_CLUSTER_KUBECONFIG \
    describe pod POD_NAME

Replace the following:

  • USER_CLUSTER_KUBECONFIG: the kubeconfig file for the user cluster running the deployment.

  • POD_NAME: the name of the pod managed by the deployment.