ves-io-schema-k8s_pod_security_policy-API-Get

Examples of getting k8spodsecurity_policy

Usecase:

Get pod-security-policy-1 from current namespace

Request using vesctl:

vesctl configuration get k8s_pod_security_policy pod-security-policy-1 --namespace system

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: pod-security-policy-1
  namespace: system
referringObjects: []
resourceVersion: "426"
spec:
  pspSpec:
    allowedCsiDrivers: []
    allowedFlexVolumes: []
    allowedHostPaths: []
    allowedProcMounts: []
    allowedUnsafeSysctls: []
    forbiddenSysctls: []
    hostNetwork: true
    noAllowedCapabilities: {}
    noDefaultCapabilities: {}
    noDropCapabilities: {}
    noFsGroups: {}
    noRunAsGroup: {}
    noRunAsUser: {}
    noRuntimeClass: {}
    noSeLinuxOptions: {}
    noSupplementalGroups: {}
    readOnlyRootFilesystem: true
    volumes:
    - config
status: []
systemMetadata:
  creationTimestamp: "2021-05-12T11:18:03.371908450Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 7b499bbe-24e0-4764-9169-5f7e1f28b894

Request using curl:

curl -X 'GET' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build672621555_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/k8s_pod_security_policys/pod-security-policy-1?response_format=0'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "object": null,
  "create_form": null,
  "replace_form": null,
  "resource_version": "426",
  "metadata": {
    "name": "pod-security-policy-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7b499bbe-24e0-4764-9169-5f7e1f28b894",
    "creation_timestamp": "2021-05-12T11:18:03.371908450Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "psp_spec": {
      "privileged": false,
      "allow_privilege_escalation": false,
      "default_allow_privilege_escalation": false,
      "no_default_capabilities": {

      },
      "no_allowed_capabilities": {

      },
      "no_drop_capabilities": {

      },
      "volumes": [
        "config"
      ],
      "allowed_flex_volumes": [
      ],
      "allowed_host_paths": [
      ],
      "allowed_proc_mounts": [
      ],
      "read_only_root_filesystem": true,
      "allowed_csi_drivers": [
      ],
      "host_network": true,
      "host_port_ranges": "",
      "host_ipc": false,
      "host_pid": false,
      "allowed_unsafe_sysctls": [
      ],
      "forbidden_sysctls": [
      ],
      "no_run_as_user": {

      },
      "no_run_as_group": {

      },
      "no_supplemental_groups": {

      },
      "no_fs_groups": {

      },
      "no_se_linux_options": {

      },
      "no_runtime_class": {

      }
    }
  },
  "status": [
  ],
  "referring_objects": [
  ]
}