Managing Kubernetes Resources

You can view the configuration details for any Kubernetes namespaces and their child resources that your administrator has given you access to.

If your administrator has also granted you the appropriate permission, you can apply, edit and delete Kubernetes resources in a namespace. This allows you to self-manage the resources in a namespace without having to rely on an administrator. For example, without requesting administrator assistance, you could can add an additional resource, such as a new microservice, into an existing namespace. You could also modify an existing resource, such as changing the image for a deployment, or even delete a resource that's no longer needed in your application.

Notes:  

  • Your administrator controls namespaces. Although you can manage the resources within a namespace, you can't edit or delete a namespace, and you can't create a namespace.
  • If you have the appropriate permission, you can also set values for custom attributes and assign ownership for Kubernetes resources as you would for other services.

In this topic:

Viewing Kubernetes resource details

To view configuration details for a namespace, select a Kubernetes namespace from the Applications widget on the Dashboard or from the Applications page.

The child resources displayed for the namespace may include: services, ingresses, deployments, replica sets and replication controllers, stateful sets, pods and persistent volume claims. You can filter and sort the listed resources by name, type, status or label.

To view configuration details for a child resource, select that resource and configuration details will display in the Resources section.

In the following example, a selected pod's details are displayed. Notice that the pod is pending and isn't ready. The resources that it's controlled by are listed as links. Here the pod is controlled by a deployment and a replica set. You can click the links to view details about those controlling resources.

Viewing Kubernetes resource config files

To view more detailed information for a namespace or its child resources, you can view the YAML configuration files for those resources.

To view a namespace's YAML config file:

  1. From the Actions menu, select Kubernetes > View YAML.

    The config file is displayed in the View YAML dialog.

    Note: To save a local copy of the config file, click Download YAML.

  2. Click Close.

To view a child resource's YAML config file:

  1. In the Resources section, select a resource.
  2. Click the View or Modify link at the right side of the section. The link that's available depends on your permissions.

    The config file is displayed in the View YAML or Edit YAML dialog.

    Note: To save a local copy of the config file, click Download YAML.

  3. Click Close.

Applying Kubernetes resources

You can use a valid YAML configuration file to provide a manifest of the resources that you want to apply to a namespace. Applying resources allows you to create new resources for the namespace and/or update existing resources that belong to the namespace. An apply operation can create and/or update multiple resources at once.

The system will validate the provided config file, then generate a task to create or update the resources in the order they're listed.

Note: If a resource can't be created or updated, the task will fail at that point, but it won't roll back any successful create or update resource operations that preceded the failure. Task information displayed in the Service Portal will indicate the failure. After you correct the config file and reapply it, the task will perform update operations for any existing resources and create operations for any resources that weren't created before the error.

To apply a resource in the namespace:

  1. Copy the contents of the YAML configuration file that you want to use.
  2. From the Actions menu, select Kubernetes > Apply Resources.
  3. In the Apply Resources dialog, paste in the copied YAML config file text.

    Note: You can also click Import to browse to a saved config file, then click OK to automatically load a copy of the configuration.

  4. Click Apply.

    Notes:  

    • If errors are displayed at the bottom of the dialog, you must correct those errors to apply the resources. (You can hover over any message to view the full details.)
    • If you want to save a local copy of the config file, click Download YAML.

Editing Kubernetes resources

To modify an existing resource in the namespace, you can edit that resource's YAML configuration file. The system will validate the edited file, then update the resource.

Note: You can't edit a resource that's controlled by another resource (for example, you can't edit a pod that's controlled by a replica set).

To edit a resource in the namespace:

  1. In the Resources section, select a resource.
  2. Click the Edit link on the right.
  3. In the Edit YAML dialog, edit the resource's configuration file as required.

    Notes:  

    • Depending on your environment, there may be a delay before the update task completes and the configuration details are updated in the Resources section.
    • If you want to use a saved YAML config file for the selected resource, click Import. Browse to the config file and click OK. The imported configuration will replace the resource's current configuration. You can edit the imported file, if required.
  4. Click Save.

    Note: If errors are displayed at the bottom of the dialog, you must correct those errors before you can save your configuration changes. (You can hover over any message to view the full details.)

Deleting Kubernetes resources

To delete a resource from a namespace:

  1. In the Resources section, select a resource.
  2. Click the Delete link on the right.
  3. In the Delete Resource dialog, click Delete.

    Notes:  

    • Depending on your environment, there may be a delay before the delete task is shown as completed in the Tasks section.
    • When you delete a resource that has dependent resources (for example, a replica set with child pods), both the parent and its children are deleted. However, if you delete a resource that's controlled by a parent resource (for example, if you delete a pod that's controlled by a replica set), the controlling resource may create a new resource to replace it.