ves-io-schema-k8s_pod_security_policy-API-Get
On This Page:
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
resourceVersion: "407"
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-02-22T15:44:06.225423800Z"
creatorClass: examplesvc
creatorId: examplesvc
finalizers: []
tenant: acmecorp
uid: f754ea83-94fd-4ed1-87b0-454b694820b7
Request using curl:
curl -X 'GET' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build817539475_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: Mon, 22 Feb 2021 15:44:06 GMT
Vary: Accept-Encoding
{
"object": null,
"create_form": null,
"replace_form": null,
"resource_version": "407",
"metadata": {
"name": "pod-security-policy-1",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "f754ea83-94fd-4ed1-87b0-454b694820b7",
"creation_timestamp": "2021-02-22T15:44:06.225423800Z",
"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": [
]
}