Skip to content

k8s list-configmaps

Get k8s configmap

Description

Get the kubernetes configmaps that satisfies the provided arguments

Synopsis

k8s list-configmaps
    [--site <site>]
    [--cluster <cluster>]
    [--namespace|-n <namespace>]
    [<selector>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Cluster where this command will be executed
     Example: --cluster "in-cluster"
     Default: in-cluster      Attributes: optional

namespace - (string)

     Kubernetes namespace
     Example: --namespace "namespace-1"
     Default: default      Attributes: optional

selector - (string)

     Selector to select the configmaps
     Example: "env=prod,!partition"
     Default: _None_      Attributes: optional

Examples

Input:

! k8s list-configmaps
Output:
NAME                   DATA
kube-root-ca.crt       -
r1-maira-agent-aws     -
r1-maira-agent-config  -
r1-maira-agent-ssh     -
Input:
x = ! k8s list-configmaps
Output:
[
    {
      "cluster": "in-cluster",
      "namespace": "default",
      "name": "dynamic-config",
      "annotations": {
          "meta.helm.sh/release-name": "test",
          "meta.helm.sh/release-namespace": "default"
      },
      "labels": {
          "app.kubernetes.io/instance": "test",
          "app.kubernetes.io/managed-by": "Helm",
          "app.kubernetes.io/version": "1.12.0",
          "helm.sh/chart": "test-0.12.0"
      },
      "data": {
          "dynamic_config.yaml": ""
      }
    }
]

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "k8s"
Service Instance cluster
Namespace namespace
Object Type "configmap"
Object ID

Please see Access Control for details.