ContainerSpec ================================== .. toctree:: :maxdepth: 2 :caption: Contents: ======== Functions --------- set +++ Set any specific field to a value **Args** * \*\*kwargs * Arbitrary list of keys as variables in formation of YAML path separated by underscores with their assocaited values. For example, to set the value at .. code-block:: JSON { "spec": { "template": { "spec": "" } } } use .. code-block:: Python obj.set(spec_template_spec="foobar") * You can also specify an incomplete path and k8sGen will attempt to find a unique location whose ending path matches what you have specified. For the case of the above structure, running .. code-block:: Python obj.set(template_spec="foobar") will set the same location because the only path that ends in 'template/spec' is 'spec/template/spec' **Returns** List of return values for each variable set Possible return values include: * True : value was set successfully * (False, 'invalid key name') : the key you are trying to set does not exist for this object * (False, 'abniguous key name') : the key you are trying to set does not refer to a unique location get +++ Get the values that have been set for specific fields **Args** * \*args * Arbitrary list of keys as variables in formation of YAML path separated by underscores **Returns** List of return values for each variable set Possible return values include: * {Value} : The key's value * (False, 'invalid key name') : the key you are trying to set does not exist for this object Key Names and Types ------------------- +---------------------------------------------------------------------------+-------------------------------+ | Key | Type | +===========================================================================+===============================+ | activeDeadlineSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | affinity_nodeAffinity | | +---------------------------------------------------------------------------+-------------------------------+ | affinity_podAffinity | | +---------------------------------------------------------------------------+-------------------------------+ | affinity_podAntiAffinity | | +---------------------------------------------------------------------------+-------------------------------+ | automountServiceAccountToken | | +---------------------------------------------------------------------------+-------------------------------+ | containers | <[]COMPONENT.Container> | +---------------------------------------------------------------------------+-------------------------------+ | dnsConfig | | +---------------------------------------------------------------------------+-------------------------------+ | dnsPolicy | | +---------------------------------------------------------------------------+-------------------------------+ | enableServiceLinks | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_args | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_configMapKeyRef_key | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_configMapKeyRef_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_configMapKeyRef_optional | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_fieldRef_apiVersion | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_fieldRef_fieldPath | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_resourceFieldRef_containerName | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_resourceFieldRef_divisor | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_resourceFieldRef_resource | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_secretKeyRef_key | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_secretKeyRef_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_env_valueFrom_secretKeyRef_optional | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_envFrom_configMapRef_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_envFrom_configMapRef_optional | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_envFrom_prefix | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_envFrom_secretRef_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_envFrom_secretRef_optional | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_image | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_imagePullPolicy | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_exec_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_httpHeaders_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_httpHeaders_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_path | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_httpGet_scheme | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_tcpSocket_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_postStart_tcpSocket_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_exec_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_httpHeaders_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_httpHeaders_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_path | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_httpGet_scheme | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_tcpSocket_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_lifecycle_preStop_tcpSocket_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_exec_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_failureThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_httpHeaders_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_httpHeaders_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_path | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_httpGet_scheme | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_initialDelaySeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_periodSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_successThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_tcpSocket_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_tcpSocket_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_livenessProbe_timeoutSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_ports_containerPort | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_ports_hostIP | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_ports_hostPort | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_ports_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_ports_protocol | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_exec_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_failureThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_httpHeaders_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_httpHeaders_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_path | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_httpGet_scheme | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_initialDelaySeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_periodSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_successThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_tcpSocket_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_tcpSocket_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_readinessProbe_timeoutSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_resources_limits | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_resources_requests | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_allowPrivilegeEscalation | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_capabilities_add | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_capabilities_drop | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_privileged | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_procMount | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_readOnlyRootFilesystem | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_runAsGroup | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_runAsNonRoot | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_runAsUser | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_seLinuxOptions_level | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_seLinuxOptions_role | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_seLinuxOptions_type | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_seLinuxOptions_user | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_windowsOptions_gmsaCredentialSpec | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_windowsOptions_gmsaCredentialSpecName | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_securityContext_windowsOptions_runAsUserName | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_exec_command | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_failureThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_httpHeaders_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_httpHeaders_value | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_path | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_httpGet_scheme | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_initialDelaySeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_periodSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_successThreshold | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_tcpSocket_host | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_tcpSocket_port | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_startupProbe_timeoutSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_stdin | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_stdinOnce | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_targetContainerName | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_terminationMessagePath | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_terminationMessagePolicy | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_tty | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeDevices_devicePath | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeDevices_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_mountPath | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_mountPropagation | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_name | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_readOnly | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_subPath | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_volumeMounts_subPathExpr | | +---------------------------------------------------------------------------+-------------------------------+ | ephemeralContainers_workingDir | | +---------------------------------------------------------------------------+-------------------------------+ | hostAliases | <[]COMPONENT.HostAlias> | +---------------------------------------------------------------------------+-------------------------------+ | hostIPC | | +---------------------------------------------------------------------------+-------------------------------+ | hostNetwork | | +---------------------------------------------------------------------------+-------------------------------+ | hostPID | | +---------------------------------------------------------------------------+-------------------------------+ | hostname | | +---------------------------------------------------------------------------+-------------------------------+ | imagePullSecrets | <[]COMPONENT.ImagePullSecret> | +---------------------------------------------------------------------------+-------------------------------+ | initContainers | <[]COMPONENT.Container> | +---------------------------------------------------------------------------+-------------------------------+ | nodeName | | +---------------------------------------------------------------------------+-------------------------------+ | nodeSelector | | +---------------------------------------------------------------------------+-------------------------------+ | overhead | | +---------------------------------------------------------------------------+-------------------------------+ | preemptionPolicy | | +---------------------------------------------------------------------------+-------------------------------+ | priority | | +---------------------------------------------------------------------------+-------------------------------+ | priorityClassName | | +---------------------------------------------------------------------------+-------------------------------+ | readinessGates | <[]COMPONENT.ReadinessGate> | +---------------------------------------------------------------------------+-------------------------------+ | restartPolicy | | +---------------------------------------------------------------------------+-------------------------------+ | runtimeClassName | | +---------------------------------------------------------------------------+-------------------------------+ | schedulerName | | +---------------------------------------------------------------------------+-------------------------------+ | securityContext | | +---------------------------------------------------------------------------+-------------------------------+ | serviceAccount | | +---------------------------------------------------------------------------+-------------------------------+ | serviceAccountName | | +---------------------------------------------------------------------------+-------------------------------+ | shareProcessNamespace | | +---------------------------------------------------------------------------+-------------------------------+ | subdomain | | +---------------------------------------------------------------------------+-------------------------------+ | terminationGracePeriodSeconds | | +---------------------------------------------------------------------------+-------------------------------+ | tolerations | <[]COMPONENT.Tolerations> | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_labelSelector_matchExpressions_key | | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_labelSelector_matchExpressions_operator | | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_labelSelector_matchExpressions_values | <[]string> | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_labelSelector_matchLabels | | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_maxSkew | | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_topologyKey | | +---------------------------------------------------------------------------+-------------------------------+ | topologySpreadConstraints_whenUnsatisfiable | | +---------------------------------------------------------------------------+-------------------------------+ | volumes | <[]COMPONENT.Volume> | +---------------------------------------------------------------------------+-------------------------------+ JSON fields ----------- .. code-block:: JSON { "activeDeadlineSeconds": "", "affinity": { "nodeAffinity": "", "podAffinity": "", "podAntiAffinity": "" }, "automountServiceAccountToken": "", "containers": "<[]COMPONENT.Container>", "dnsConfig": "", "dnsPolicy": "", "enableServiceLinks": "", "ephemeralContainers": [ { "args": "<[]string>", "command": "<[]string>", "env": [ { "name": "", "value": "", "valueFrom": { "configMapKeyRef": { "key": "", "name": "", "optional": "" }, "fieldRef": { "apiVersion": "", "fieldPath": "" }, "resourceFieldRef": { "containerName": "", "divisor": "", "resource": "" }, "secretKeyRef": { "key": "", "name": "", "optional": "" } } } ], "envFrom": [ { "configMapRef": { "name": "", "optional": "" }, "prefix": "", "secretRef": { "name": "", "optional": "" } } ], "image": "", "imagePullPolicy": "", "lifecycle": { "postStart": { "exec": { "command": "<[]string>" }, "httpGet": { "host": "", "httpHeaders": [ { "name": "", "value": "" } ], "path": "", "port": "", "scheme": "" }, "tcpSocket": { "host": "", "port": "" } }, "preStop": { "exec": { "command": "<[]string>" }, "httpGet": { "host": "", "httpHeaders": [ { "name": "", "value": "" } ], "path": "", "port": "", "scheme": "" }, "tcpSocket": { "host": "", "port": "" } } }, "livenessProbe": { "exec": { "command": "<[]string>" }, "failureThreshold": "", "httpGet": { "host": "", "httpHeaders": [ { "name": "", "value": "" } ], "path": "", "port": "", "scheme": "" }, "initialDelaySeconds": "", "periodSeconds": "", "successThreshold": "", "tcpSocket": { "host": "", "port": "" }, "timeoutSeconds": "" }, "name": "", "ports": [ { "containerPort": "", "hostIP": "", "hostPort": "", "name": "", "protocol": "" } ], "readinessProbe": { "exec": { "command": "<[]string>" }, "failureThreshold": "", "httpGet": { "host": "", "httpHeaders": [ { "name": "", "value": "" } ], "path": "", "port": "", "scheme": "" }, "initialDelaySeconds": "", "periodSeconds": "", "successThreshold": "", "tcpSocket": { "host": "", "port": "" }, "timeoutSeconds": "" }, "resources": { "limits": "", "requests": "" }, "securityContext": { "allowPrivilegeEscalation": "", "capabilities": { "add": "<[]string>", "drop": "<[]string>" }, "privileged": "", "procMount": "", "readOnlyRootFilesystem": "", "runAsGroup": "", "runAsNonRoot": "", "runAsUser": "", "seLinuxOptions": { "level": "", "role": "", "type": "", "user": "" }, "windowsOptions": { "gmsaCredentialSpec": "", "gmsaCredentialSpecName": "", "runAsUserName": "" } }, "startupProbe": { "exec": { "command": "<[]string>" }, "failureThreshold": "", "httpGet": { "host": "", "httpHeaders": [ { "name": "", "value": "" } ], "path": "", "port": "", "scheme": "" }, "initialDelaySeconds": "", "periodSeconds": "", "successThreshold": "", "tcpSocket": { "host": "", "port": "" }, "timeoutSeconds": "" }, "stdin": "", "stdinOnce": "", "targetContainerName": "", "terminationMessagePath": "", "terminationMessagePolicy": "", "tty": "", "volumeDevices": [ { "devicePath": "", "name": "" } ], "volumeMounts": [ { "mountPath": "", "mountPropagation": "", "name": "", "readOnly": "", "subPath": "", "subPathExpr": "" } ], "workingDir": "" } ], "hostAliases": "<[]COMPONENT.HostAlias>", "hostIPC": "", "hostNetwork": "", "hostPID": "", "hostname": "", "imagePullSecrets": "<[]COMPONENT.ImagePullSecret>", "initContainers": "<[]COMPONENT.Container>", "nodeName": "", "nodeSelector": "", "overhead": "", "preemptionPolicy": "", "priority": "", "priorityClassName": "", "readinessGates": "<[]COMPONENT.ReadinessGate>", "restartPolicy": "", "runtimeClassName": "", "schedulerName": "", "securityContext": "", "serviceAccount": "", "serviceAccountName": "", "shareProcessNamespace": "", "subdomain": "", "terminationGracePeriodSeconds": "", "tolerations": "<[]COMPONENT.Tolerations>", "topologySpreadConstraints": [ { "labelSelector": { "matchExpressions": [ { "key": "", "operator": "", "values": "<[]string>" } ], "matchLabels": "" }, "maxSkew": "", "topologyKey": "", "whenUnsatisfiable": "" } ], "volumes": "<[]COMPONENT.Volume>" }