diff --git a/class_generator/class_generator.py b/class_generator/class_generator.py index e0962ef650..d3cb600130 100644 --- a/class_generator/class_generator.py +++ b/class_generator/class_generator.py @@ -39,6 +39,64 @@ TESTS_MANIFESTS_DIR = "class_generator/tests/manifests" +def process_fields_args( + fields_output: str, + output_dict: Dict[str, Any], + dict_key: str, + kind: str, + debug: bool, + output_debug_file_path: str, + add_tests: bool, + debug_content: Optional[Dict[str, str]] = None, + args_to_ignore: Optional[List[str]] = None, +) -> Dict[str, Any]: + if _fields_args := re.findall(r" .*", fields_output, re.DOTALL): + for field in [_field for _field in _fields_args[0].splitlines() if _field]: + if args_to_ignore and field.split()[0] in args_to_ignore: + continue + + # If line is indented 4 spaces we know that this is a field under spec + if len(re.findall(r" +", field)[0]) == 2: + output_dict[dict_key].append( + get_arg_params( + field=field.strip(), + kind=kind, + field_under_spec=True if dict_key == SPEC_STR else False, + debug=debug, + debug_content=debug_content, + output_debug_file_path=output_debug_file_path, + add_tests=add_tests, + ) + ) + + return output_dict + + +def get_sections_dict(output: str) -> Dict[str, str]: + raw_resource_dict: Dict[str, str] = {} + + # Get all sections from output, section is [A-Z]: for example `KIND:` + sections = re.findall(r"([A-Z]+):.*", output) + + # Get all sections indexes to be able to get needed test from output by indexes later + sections_indexes = [output.index(section) for section in sections] + + for idx, section_idx in enumerate(sections_indexes): + _section_name = sections[idx].strip(":") + + # Get the end index of the section name, add +1 since we strip the `:` + _end_of_section_name_idx = section_idx + len(_section_name) + 1 + + try: + # If we have next section we get the string from output till the next section + raw_resource_dict[_section_name] = output[_end_of_section_name_idx : output.index(sections[idx + 1])] + except IndexError: + # If this is the last section get the rest of output + raw_resource_dict[_section_name] = output[_end_of_section_name_idx:] + + return raw_resource_dict + + def get_oc_or_kubectl() -> str: if run_command(command=shlex.split("which oc"), check=False)[0]: return "oc" @@ -76,7 +134,7 @@ def get_kind_data_and_debug_file(kind: str, debug: bool = False, add_tests: bool """ Get oc/kubectl explain output for given kind, if kind is namespaced and debug filepath """ - _, explain_out, _ = run_command(command=shlex.split(f"oc explain {kind} --recursive")) + _, explain_out, _ = run_command(command=shlex.split(f"oc explain {kind}")) resource_kind = re.search(r".*?KIND:\s+(.*?)\n", explain_out) resource_kind_str: str = "" @@ -395,31 +453,11 @@ def parse_explain( debug_content: Optional[Dict[str, str]] = None, add_tests: bool = False, ) -> Dict[str, Any]: - sections: List[str] = [] resource_dict: Dict[str, Any] = { "BASE_CLASS": "NamespacedResource" if namespaced else "Resource", } - raw_resource_dict: Dict[str, str] = {} - - # Get all sections from output, section is [A-Z]: for example `KIND:` - sections = re.findall(r"([A-Z]+):.*", output) - - # Get all sections indexes to be able to get needed test from output by indexes later - sections_indexes = [output.index(section) for section in sections] - - for idx, section_idx in enumerate(sections_indexes): - _section_name = sections[idx].strip(":") - - # Get the end index of the section name, add +1 since we strip the `:` - _end_of_section_name_idx = section_idx + len(_section_name) + 1 - - try: - # If we have next section we get the string from output till the next section - raw_resource_dict[_section_name] = output[_end_of_section_name_idx : output.index(sections[idx + 1])] - except IndexError: - # If this is the last section get the rest of output - raw_resource_dict[_section_name] = output[_end_of_section_name_idx:] + raw_resource_dict = get_sections_dict(output=output) resource_dict["KIND"] = raw_resource_dict["KIND"].strip() resource_dict["DESCRIPTION"] = raw_resource_dict["DESCRIPTION"].strip() @@ -435,46 +473,46 @@ def parse_explain( resource_dict[SPEC_STR] = [] resource_dict[FIELDS_STR] = [] - # Get all spec fields till spec indent is done, section indent is 2 empty spaces - # ``` - # spec - # allocateLoadBalancerNodePorts - # type - # status - # ``` - if _spec_fields := re.findall(rf" {SPEC_STR.lower()}.*(?=\n [a-z])", raw_resource_dict[FIELDS_STR], re.DOTALL): - for field in [_field for _field in _spec_fields[0].splitlines() if _field]: - # If line is indented 4 spaces we know that this is a field under spec - if len(re.findall(r" +", field)[0]) == 4: - resource_dict[SPEC_STR].append( - get_arg_params( - field=field.strip(), - kind=kind, - field_under_spec=True, - debug=debug, - debug_content=debug_content, - output_debug_file_path=output_debug_file_path, - add_tests=add_tests, - ) - ) + # Get kind spec + spec_out: str = "" + if debug_content: + if debug_content: + spec_out = debug_content.get("explain-spec", "") + else: + rc, spec_out, _ = run_command(command=shlex.split(f"oc explain {kind}.spec"), check=False, log_errors=False) + if not rc: + LOGGER.warning(f"{kind} spec not found, skipping") + + _spec_sections_dict = get_sections_dict(output=spec_out) + if _spec_fields := _spec_sections_dict.get(FIELDS_STR): + if output_debug_file_path: + write_to_file( + data={"explain-spec": spec_out}, + output_debug_file_path=output_debug_file_path, + ) - if _fields := re.findall(r" .*", raw_resource_dict[FIELDS_STR], re.DOTALL): - for line in [_line for _line in _fields[0].splitlines() if _line]: - if line.split()[0] in keys_to_ignore: - continue + resource_dict = process_fields_args( + fields_output=_spec_fields, + output_dict=resource_dict, + dict_key=SPEC_STR, + kind=kind, + add_tests=add_tests, + debug=debug, + debug_content=debug_content, + output_debug_file_path=output_debug_file_path, + ) - # Process only top level fields with 2 spaces indent - if len(re.findall(r" +", line)[0]) == 2: - resource_dict[FIELDS_STR].append( - get_arg_params( - field=line, - kind=kind, - debug=debug, - debug_content=debug_content, - output_debug_file_path=output_debug_file_path, - add_tests=add_tests, - ) - ) + resource_dict = process_fields_args( + fields_output=raw_resource_dict[FIELDS_STR], + output_dict=resource_dict, + dict_key=FIELDS_STR, + kind=kind, + add_tests=add_tests, + debug=debug, + debug_content=debug_content, + output_debug_file_path=output_debug_file_path, + args_to_ignore=keys_to_ignore, + ) api_group_real_name = resource_dict.get("GROUP") # If API Group is not present in resource, try to get it from VERSION diff --git a/class_generator/tests/manifests/api_server/api_server_debug.json b/class_generator/tests/manifests/api_server/api_server_debug.json index 3a2819a133..5225a2df89 100644 --- a/class_generator/tests/manifests/api_server/api_server_debug.json +++ b/class_generator/tests/manifests/api_server/api_server_debug.json @@ -1,10 +1,11 @@ { - "explain": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nDESCRIPTION:\n APIServer holds configuration (like serving certificates, client CA and CORS\n domains) shared by all API servers in the system, among them especially\n kube-apiserver and openshift-apiserver. The canonical name of an instance is\n 'cluster'. \n Compatibility level 1: Stable within a major release for a minimum of 12\n months or 3 minor releases (whichever is longer).\n \nFIELDS:\n apiVersion\t\n kind\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t -required-\n additionalCORSAllowedOrigins\t<[]string>\n audit\t\n customRules\t<[]Object>\n group\t -required-\n profile\t -required-\n profile\t\n clientCA\t\n name\t -required-\n encryption\t\n type\t\n servingCerts\t\n namedCertificates\t<[]Object>\n names\t<[]string>\n servingCertificate\t\n name\t -required-\n tlsSecurityProfile\t\n custom\t\n ciphers\t<[]string>\n minTLSVersion\t\n intermediate\t\n modern\t\n old\t\n type\t\n status\t\n\n", + "explain": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nDESCRIPTION:\n APIServer holds configuration (like serving certificates, client CA and CORS\n domains) shared by all API servers in the system, among them especially\n kube-apiserver and openshift-apiserver. The canonical name of an instance is\n 'cluster'. \n Compatibility level 1: Stable within a major release for a minimum of 12\n months or 3 minor releases (whichever is longer).\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t -required-\n spec holds user settable values for configuration\n\n status\t\n status holds observed values from the cluster. They may not be overridden.\n\n\n", "namespace": "0\n", "explain-additionalCORSAllowedOrigins": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: additionalCORSAllowedOrigins <[]string>\n\nDESCRIPTION:\n additionalCORSAllowedOrigins lists additional, user-defined regular\n expressions describing hosts for which the API server allows access using\n the CORS headers. This may be needed to access the API and the integrated\n OAuth server from JavaScript applications. The values are regular\n expressions that correspond to the Golang regular expression language.\n \n\n", "explain-audit": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: audit \n\nDESCRIPTION:\n audit specifies the settings for audit configuration to be applied to all\n OpenShift-provided API servers in the cluster.\n \nFIELDS:\n customRules\t<[]Object>\n customRules specify profiles per group. These profile take precedence over\n the top-level profile field if they apply. They are evaluation from top to\n bottom and the first one that matches, applies.\n\n profile\t\n profile specifies the name of the desired top-level audit profile to be\n applied to all requests sent to any of the OpenShift-provided API servers in\n the cluster (kube-apiserver, openshift-apiserver and oauth-apiserver), with\n the exception of those requests that match one or more of the customRules. \n The following profiles are provided: - Default: default policy which means\n MetaData level logging with the exception of events (not logged at all),\n oauthaccesstokens and oauthauthorizetokens (both logged at RequestBody\n level). - WriteRequestBodies: like 'Default', but logs request and response\n HTTP payloads for write requests (create, update, patch). -\n AllRequestBodies: like 'WriteRequestBodies', but also logs request and\n response HTTP payloads for read requests (get, list). - None: no requests\n are logged at all, not even oauthaccesstokens and oauthauthorizetokens. \n Warning: It is not recommended to disable audit logging by using the `None`\n profile unless you are fully aware of the risks of not logging data that can\n be beneficial when troubleshooting issues. If you disable audit logging and\n a support situation arises, you might need to enable audit logging and\n reproduce the issue in order to troubleshoot properly. \n If unset, the 'Default' profile is used as the default.\n\n\n", "explain-clientCA": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: clientCA \n\nDESCRIPTION:\n clientCA references a ConfigMap containing a certificate bundle for the\n signers that will be recognized for incoming client certificates in addition\n to the operator managed signers. If this is empty, then only operator\n managed signers are valid. You usually only have to set this if you have\n your own PKI you wish to honor client certificates from. The ConfigMap must\n exist in the openshift-config namespace and contain the following required\n fields: - ConfigMap.Data[\"ca-bundle.crt\"] - CA bundle.\n \nFIELDS:\n name\t -required-\n name is the metadata.name of the referenced config map\n\n\n", "explain-encryption": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: encryption \n\nDESCRIPTION:\n encryption allows the configuration of encryption of resources at the\n datastore layer.\n \nFIELDS:\n type\t\n type defines what encryption type should be used to encrypt resources at the\n datastore layer. When this field is unset (i.e. when it is set to the empty\n string), identity is implied. The behavior of unset can and will change over\n time. Even if encryption is enabled by default, the meaning of unset may\n change to a different encryption type based on changes in best practices. \n When encryption is enabled, all sensitive resources shipped with the\n platform are encrypted. This list of sensitive resources can and will change\n over time. The current authoritative list is: \n 1. secrets 2. configmaps 3. routes.route.openshift.io 4.\n oauthaccesstokens.oauth.openshift.io 5.\n oauthauthorizetokens.oauth.openshift.io\n\n\n", "explain-servingCerts": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: servingCerts \n\nDESCRIPTION:\n servingCert is the TLS cert info for serving secure traffic. If not\n specified, operator managed certificates will be used for serving secure\n traffic.\n \nFIELDS:\n namedCertificates\t<[]Object>\n namedCertificates references secrets containing the TLS cert info for\n serving secure traffic to specific hostnames. If no named certificates are\n provided, or no named certificates match the server name as understood by a\n client, the defaultServingCertificate will be used.\n\n\n", - "explain-tlsSecurityProfile": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: tlsSecurityProfile \n\nDESCRIPTION:\n tlsSecurityProfile specifies settings for TLS connections for externally\n exposed servers. \n If unset, a default (which may change between releases) is chosen. Note\n that only Old, Intermediate and Custom profiles are currently supported, and\n the maximum available minTLSVersion is VersionTLS12.\n \nFIELDS:\n custom\t\n custom is a user-defined TLS security profile. Be extremely careful using a\n custom profile as invalid configurations can be catastrophic. An example\n custom profile looks like this: \n ciphers: \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n minTLSVersion: VersionTLS11\n\n intermediate\t\n intermediate is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29\n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES256-GCM-SHA384 \n - ECDHE-RSA-AES256-GCM-SHA384 \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384 \n minTLSVersion: VersionTLS12\n\n modern\t\n modern is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility \n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n minTLSVersion: VersionTLS13\n\n old\t\n old is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility\n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES256-GCM-SHA384 \n - ECDHE-RSA-AES256-GCM-SHA384 \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384 \n - DHE-RSA-CHACHA20-POLY1305 \n - ECDHE-ECDSA-AES128-SHA256 \n - ECDHE-RSA-AES128-SHA256 \n - ECDHE-ECDSA-AES128-SHA \n - ECDHE-RSA-AES128-SHA \n - ECDHE-ECDSA-AES256-SHA384 \n - ECDHE-RSA-AES256-SHA384 \n - ECDHE-ECDSA-AES256-SHA \n - ECDHE-RSA-AES256-SHA \n - DHE-RSA-AES128-SHA256 \n - DHE-RSA-AES256-SHA256 \n - AES128-GCM-SHA256 \n - AES256-GCM-SHA384 \n - AES128-SHA256 \n - AES256-SHA256 \n - AES128-SHA \n - AES256-SHA \n - DES-CBC3-SHA \n minTLSVersion: VersionTLS10\n\n type\t\n type is one of Old, Intermediate, Modern or Custom. Custom provides the\n ability to specify individual TLS security profile parameters. Old,\n Intermediate and Modern are TLS security profiles based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations\n The profiles are intent based, so they may change over time as new ciphers\n are developed and existing ciphers are found to be insecure. Depending on\n precisely which ciphers are available to a process, the list may be reduced.\n Note that the Modern profile is currently not supported because it is not\n yet well adopted by common software libraries.\n\n\n" + "explain-tlsSecurityProfile": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: tlsSecurityProfile \n\nDESCRIPTION:\n tlsSecurityProfile specifies settings for TLS connections for externally\n exposed servers. \n If unset, a default (which may change between releases) is chosen. Note\n that only Old, Intermediate and Custom profiles are currently supported, and\n the maximum available minTLSVersion is VersionTLS12.\n \nFIELDS:\n custom\t\n custom is a user-defined TLS security profile. Be extremely careful using a\n custom profile as invalid configurations can be catastrophic. An example\n custom profile looks like this: \n ciphers: \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n minTLSVersion: VersionTLS11\n\n intermediate\t\n intermediate is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29\n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES256-GCM-SHA384 \n - ECDHE-RSA-AES256-GCM-SHA384 \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384 \n minTLSVersion: VersionTLS12\n\n modern\t\n modern is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility \n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n minTLSVersion: VersionTLS13\n\n old\t\n old is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility\n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256 \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256 \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES256-GCM-SHA384 \n - ECDHE-RSA-AES256-GCM-SHA384 \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305 \n - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384 \n - DHE-RSA-CHACHA20-POLY1305 \n - ECDHE-ECDSA-AES128-SHA256 \n - ECDHE-RSA-AES128-SHA256 \n - ECDHE-ECDSA-AES128-SHA \n - ECDHE-RSA-AES128-SHA \n - ECDHE-ECDSA-AES256-SHA384 \n - ECDHE-RSA-AES256-SHA384 \n - ECDHE-ECDSA-AES256-SHA \n - ECDHE-RSA-AES256-SHA \n - DHE-RSA-AES128-SHA256 \n - DHE-RSA-AES256-SHA256 \n - AES128-GCM-SHA256 \n - AES256-GCM-SHA384 \n - AES128-SHA256 \n - AES256-SHA256 \n - AES128-SHA \n - AES256-SHA \n - DES-CBC3-SHA \n minTLSVersion: VersionTLS10\n\n type\t\n type is one of Old, Intermediate, Modern or Custom. Custom provides the\n ability to specify individual TLS security profile parameters. Old,\n Intermediate and Modern are TLS security profiles based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations\n The profiles are intent based, so they may change over time as new ciphers\n are developed and existing ciphers are found to be insecure. Depending on\n precisely which ciphers are available to a process, the list may be reduced.\n Note that the Modern profile is currently not supported because it is not\n yet well adopted by common software libraries.\n\n\n", + "explain-spec": "GROUP: config.openshift.io\nKIND: APIServer\nVERSION: v1\n\nFIELD: spec \n\nDESCRIPTION:\n spec holds user settable values for configuration\n \nFIELDS:\n additionalCORSAllowedOrigins\t<[]string>\n additionalCORSAllowedOrigins lists additional, user-defined regular\n expressions describing hosts for which the API server allows access using\n the CORS headers. This may be needed to access the API and the integrated\n OAuth server from JavaScript applications. The values are regular\n expressions that correspond to the Golang regular expression language.\n\n audit\t\n audit specifies the settings for audit configuration to be applied to all\n OpenShift-provided API servers in the cluster.\n\n clientCA\t\n clientCA references a ConfigMap containing a certificate bundle for the\n signers that will be recognized for incoming client certificates in addition\n to the operator managed signers. If this is empty, then only operator\n managed signers are valid. You usually only have to set this if you have\n your own PKI you wish to honor client certificates from. The ConfigMap must\n exist in the openshift-config namespace and contain the following required\n fields: - ConfigMap.Data[\"ca-bundle.crt\"] - CA bundle.\n\n encryption\t\n encryption allows the configuration of encryption of resources at the\n datastore layer.\n\n servingCerts\t\n servingCert is the TLS cert info for serving secure traffic. If not\n specified, operator managed certificates will be used for serving secure\n traffic.\n\n tlsSecurityProfile\t\n tlsSecurityProfile specifies settings for TLS connections for externally\n exposed servers. \n If unset, a default (which may change between releases) is chosen. Note\n that only Old, Intermediate and Custom profiles are currently supported, and\n the maximum available minTLSVersion is VersionTLS12.\n\n\n" } diff --git a/class_generator/tests/manifests/cluster_operator/cluster_operator_debug.json b/class_generator/tests/manifests/cluster_operator/cluster_operator_debug.json index b5014d1f51..ef926ad297 100644 --- a/class_generator/tests/manifests/cluster_operator/cluster_operator_debug.json +++ b/class_generator/tests/manifests/cluster_operator/cluster_operator_debug.json @@ -1,4 +1,4 @@ { - "explain": "GROUP: config.openshift.io\nKIND: ClusterOperator\nVERSION: v1\n\nDESCRIPTION:\n ClusterOperator is the Custom Resource object which holds the current state\n of an operator. This object is used by operators to convey their state to\n the rest of the cluster. \n Compatibility level 1: Stable within a major release for a minimum of 12\n months or 3 minor releases (whichever is longer).\n \nFIELDS:\n apiVersion\t\n kind\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t -required-\n status\t\n conditions\t<[]Object>\n lastTransitionTime\t -required-\n message\t\n reason\t\n status\t -required-\n type\t -required-\n extension\t\n relatedObjects\t<[]Object>\n group\t -required-\n name\t -required-\n namespace\t\n resource\t -required-\n versions\t<[]Object>\n name\t -required-\n version\t -required-\n\n", + "explain": "GROUP: config.openshift.io\nKIND: ClusterOperator\nVERSION: v1\n\nDESCRIPTION:\n ClusterOperator is the Custom Resource object which holds the current state\n of an operator. This object is used by operators to convey their state to\n the rest of the cluster. \n Compatibility level 1: Stable within a major release for a minimum of 12\n months or 3 minor releases (whichever is longer).\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t -required-\n spec holds configuration that could apply to any operator.\n\n status\t\n status holds the information about the state of an operator. It is\n consistent with status information across the Kubernetes ecosystem.\n\n\n", "namespace": "0\n" } diff --git a/class_generator/tests/manifests/config_map/config_map_debug.json b/class_generator/tests/manifests/config_map/config_map_debug.json index b2a66cf3e8..39484df9ea 100644 --- a/class_generator/tests/manifests/config_map/config_map_debug.json +++ b/class_generator/tests/manifests/config_map/config_map_debug.json @@ -1,5 +1,5 @@ { - "explain": "KIND: ConfigMap\nVERSION: v1\n\nDESCRIPTION:\n ConfigMap holds configuration data for pods to consume.\n \nFIELDS:\n apiVersion\t\n binaryData\t\n data\t\n immutable\t\n kind\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n\n", + "explain": "KIND: ConfigMap\nVERSION: v1\n\nDESCRIPTION:\n ConfigMap holds configuration data for pods to consume.\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n binaryData\t\n BinaryData contains the binary data. Each key must consist of alphanumeric\n characters, '-', '_' or '.'. BinaryData can contain byte sequences that are\n not in the UTF-8 range. The keys stored in BinaryData must not overlap with\n the ones in the Data field, this is enforced during validation process.\n Using this field will require 1.10+ apiserver and kubelet.\n\n data\t\n Data contains the configuration data. Each key must consist of alphanumeric\n characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use\n the BinaryData field. The keys stored in Data must not overlap with the keys\n in the BinaryData field, this is enforced during validation process.\n\n immutable\t\n Immutable, if set to true, ensures that data stored in the ConfigMap cannot\n be updated (only object metadata can be modified). If not set to true, the\n field can be modified at any time. Defaulted to nil.\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n\n", "namespace": "1\n", "explain-binaryData": "KIND: ConfigMap\nVERSION: v1\n\nFIELD: binaryData \n\nDESCRIPTION:\n BinaryData contains the binary data. Each key must consist of alphanumeric\n characters, '-', '_' or '.'. BinaryData can contain byte sequences that are\n not in the UTF-8 range. The keys stored in BinaryData must not overlap with\n the ones in the Data field, this is enforced during validation process.\n Using this field will require 1.10+ apiserver and kubelet.\n \n\n", "explain-data": "KIND: ConfigMap\nVERSION: v1\n\nFIELD: data \n\nDESCRIPTION:\n Data contains the configuration data. Each key must consist of alphanumeric\n characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use\n the BinaryData field. The keys stored in Data must not overlap with the keys\n in the BinaryData field, this is enforced during validation process.\n \n\n", diff --git a/class_generator/tests/manifests/deployment/deployment_debug.json b/class_generator/tests/manifests/deployment/deployment_debug.json index 73102561ea..f98cc99de2 100644 --- a/class_generator/tests/manifests/deployment/deployment_debug.json +++ b/class_generator/tests/manifests/deployment/deployment_debug.json @@ -1,5 +1,5 @@ { - "explain": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nDESCRIPTION:\n Deployment enables declarative updates for Pods and ReplicaSets.\n \nFIELDS:\n apiVersion\t\n kind\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t\n minReadySeconds\t\n paused\t\n progressDeadlineSeconds\t\n replicas\t\n revisionHistoryLimit\t\n selector\t -required-\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n strategy\t\n rollingUpdate\t\n maxSurge\t\n maxUnavailable\t\n type\t\n template\t -required-\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t\n activeDeadlineSeconds\t\n affinity\t\n nodeAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]PreferredSchedulingTerm>\n preference\t -required-\n matchExpressions\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchFields\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t\n nodeSelectorTerms\t<[]NodeSelectorTerm> -required-\n matchExpressions\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchFields\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n podAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]WeightedPodAffinityTerm>\n podAffinityTerm\t -required-\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t<[]PodAffinityTerm>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n podAntiAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]WeightedPodAffinityTerm>\n podAffinityTerm\t -required-\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t<[]PodAffinityTerm>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n automountServiceAccountToken\t\n containers\t<[]Container> -required-\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n dnsConfig\t\n nameservers\t<[]string>\n options\t<[]PodDNSConfigOption>\n name\t\n value\t\n searches\t<[]string>\n dnsPolicy\t\n enableServiceLinks\t\n ephemeralContainers\t<[]EphemeralContainer>\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n targetContainerName\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n hostAliases\t<[]HostAlias>\n hostnames\t<[]string>\n ip\t -required-\n hostIPC\t\n hostNetwork\t\n hostPID\t\n hostUsers\t\n hostname\t\n imagePullSecrets\t<[]LocalObjectReference>\n name\t\n initContainers\t<[]Container>\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n nodeName\t\n nodeSelector\t\n os\t\n name\t -required-\n overhead\t\n preemptionPolicy\t\n priority\t\n priorityClassName\t\n readinessGates\t<[]PodReadinessGate>\n conditionType\t -required-\n resourceClaims\t<[]PodResourceClaim>\n name\t -required-\n source\t\n resourceClaimName\t\n resourceClaimTemplateName\t\n restartPolicy\t\n runtimeClassName\t\n schedulerName\t\n schedulingGates\t<[]PodSchedulingGate>\n name\t -required-\n securityContext\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n fsGroup\t\n fsGroupChangePolicy\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n supplementalGroups\t<[]integer>\n sysctls\t<[]Sysctl>\n name\t -required-\n value\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n serviceAccount\t\n serviceAccountName\t\n setHostnameAsFQDN\t\n shareProcessNamespace\t\n subdomain\t\n terminationGracePeriodSeconds\t\n tolerations\t<[]Toleration>\n effect\t\n key\t\n operator\t\n tolerationSeconds\t\n value\t\n topologySpreadConstraints\t<[]TopologySpreadConstraint>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n maxSkew\t -required-\n minDomains\t\n nodeAffinityPolicy\t\n nodeTaintsPolicy\t\n topologyKey\t -required-\n whenUnsatisfiable\t -required-\n volumes\t<[]Volume>\n awsElasticBlockStore\t\n fsType\t\n partition\t\n readOnly\t\n volumeID\t -required-\n azureDisk\t\n cachingMode\t\n diskName\t -required-\n diskURI\t -required-\n fsType\t\n kind\t\n readOnly\t\n azureFile\t\n readOnly\t\n secretName\t -required-\n shareName\t -required-\n cephfs\t\n monitors\t<[]string> -required-\n path\t\n readOnly\t\n secretFile\t\n secretRef\t\n name\t\n user\t\n cinder\t\n fsType\t\n readOnly\t\n secretRef\t\n name\t\n volumeID\t -required-\n configMap\t\n defaultMode\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n csi\t\n driver\t -required-\n fsType\t\n nodePublishSecretRef\t\n name\t\n readOnly\t\n volumeAttributes\t\n downwardAPI\t\n defaultMode\t\n items\t<[]DownwardAPIVolumeFile>\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n mode\t\n path\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n emptyDir\t\n medium\t\n sizeLimit\t\n ephemeral\t\n volumeClaimTemplate\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t -required-\n accessModes\t<[]string>\n dataSource\t\n apiGroup\t\n kind\t -required-\n name\t -required-\n dataSourceRef\t\n apiGroup\t\n kind\t -required-\n name\t -required-\n namespace\t\n resources\t\n limits\t\n requests\t\n selector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n storageClassName\t\n volumeAttributesClassName\t\n volumeMode\t\n volumeName\t\n fc\t\n fsType\t\n lun\t\n readOnly\t\n targetWWNs\t<[]string>\n wwids\t<[]string>\n flexVolume\t\n driver\t -required-\n fsType\t\n options\t\n readOnly\t\n secretRef\t\n name\t\n flocker\t\n datasetName\t\n datasetUUID\t\n gcePersistentDisk\t\n fsType\t\n partition\t\n pdName\t -required-\n readOnly\t\n gitRepo\t\n directory\t\n repository\t -required-\n revision\t\n glusterfs\t\n endpoints\t -required-\n path\t -required-\n readOnly\t\n hostPath\t\n path\t -required-\n type\t\n iscsi\t\n chapAuthDiscovery\t\n chapAuthSession\t\n fsType\t\n initiatorName\t\n iqn\t -required-\n iscsiInterface\t\n lun\t -required-\n portals\t<[]string>\n readOnly\t\n secretRef\t\n name\t\n targetPortal\t -required-\n name\t -required-\n nfs\t\n path\t -required-\n readOnly\t\n server\t -required-\n persistentVolumeClaim\t\n claimName\t -required-\n readOnly\t\n photonPersistentDisk\t\n fsType\t\n pdID\t -required-\n portworxVolume\t\n fsType\t\n readOnly\t\n volumeID\t -required-\n projected\t\n defaultMode\t\n sources\t<[]VolumeProjection>\n clusterTrustBundle\t\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n name\t\n optional\t\n path\t -required-\n signerName\t\n configMap\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n downwardAPI\t\n items\t<[]DownwardAPIVolumeFile>\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n mode\t\n path\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secret\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n serviceAccountToken\t\n audience\t\n expirationSeconds\t\n path\t -required-\n quobyte\t\n group\t\n readOnly\t\n registry\t -required-\n tenant\t\n user\t\n volume\t -required-\n rbd\t\n fsType\t\n image\t -required-\n keyring\t\n monitors\t<[]string> -required-\n pool\t\n readOnly\t\n secretRef\t\n name\t\n user\t\n scaleIO\t\n fsType\t\n gateway\t -required-\n protectionDomain\t\n readOnly\t\n secretRef\t -required-\n name\t\n sslEnabled\t\n storageMode\t\n storagePool\t\n system\t -required-\n volumeName\t\n secret\t\n defaultMode\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n optional\t\n secretName\t\n storageos\t\n fsType\t\n readOnly\t\n secretRef\t\n name\t\n volumeName\t\n volumeNamespace\t\n vsphereVolume\t\n fsType\t\n storagePolicyID\t\n storagePolicyName\t\n volumePath\t -required-\n status\t\n availableReplicas\t\n collisionCount\t\n conditions\t<[]DeploymentCondition>\n lastTransitionTime\t\n lastUpdateTime\t\n message\t\n reason\t\n status\t -required-\n type\t -required-\n observedGeneration\t\n readyReplicas\t\n replicas\t\n unavailableReplicas\t\n updatedReplicas\t\n\n", + "explain": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nDESCRIPTION:\n Deployment enables declarative updates for Pods and ReplicaSets.\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t\n Specification of the desired behavior of the Deployment.\n\n status\t\n Most recently observed status of the Deployment.\n\n\n", "namespace": "1\n", "explain-minReadySeconds": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: minReadySeconds \n\nDESCRIPTION:\n Minimum number of seconds for which a newly created pod should be ready\n without any of its container crashing, for it to be considered available.\n Defaults to 0 (pod will be considered available as soon as it is ready)\n \n\n", "explain-paused": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: paused \n\nDESCRIPTION:\n Indicates that the deployment is paused.\n \n\n", @@ -8,5 +8,6 @@ "explain-revisionHistoryLimit": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: revisionHistoryLimit \n\nDESCRIPTION:\n The number of old ReplicaSets to retain to allow rollback. This is a pointer\n to distinguish between explicit zero and not specified. Defaults to 10.\n \n\n", "explain-selector": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: selector \n\nDESCRIPTION:\n Label selector for pods. Existing ReplicaSets whose pods are selected by\n this will be the ones affected by this deployment. It must match the pod\n template's labels.\n A label selector is a label query over a set of resources. The result of\n matchLabels and matchExpressions are ANDed. An empty label selector matches\n all objects. A null label selector matches no objects.\n \nFIELDS:\n matchExpressions\t<[]LabelSelectorRequirement>\n matchExpressions is a list of label selector requirements. The requirements\n are ANDed.\n\n matchLabels\t\n matchLabels is a map of {key,value} pairs. A single {key,value} in the\n matchLabels map is equivalent to an element of matchExpressions, whose key\n field is \"key\", the operator is \"In\", and the values array contains only\n \"value\". The requirements are ANDed.\n\n\n", "explain-strategy": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: strategy \n\nDESCRIPTION:\n The deployment strategy to use to replace existing pods with new ones.\n DeploymentStrategy describes how to replace existing pods with new ones.\n \nFIELDS:\n rollingUpdate\t\n Rolling update config params. Present only if DeploymentStrategyType =\n RollingUpdate.\n\n type\t\n Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is\n RollingUpdate.\n \n Possible enum values:\n - `\"Recreate\"` Kill all existing pods before creating new ones.\n - `\"RollingUpdate\"` Replace the old ReplicaSets by new one using rolling\n update i.e gradually scale down the old ReplicaSets and scale up the new\n one.\n\n\n", - "explain-template": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: template \n\nDESCRIPTION:\n Template describes the pods that will be created. The only allowed\n template.spec.restartPolicy value is \"Always\".\n PodTemplateSpec describes the data a pod should have when created from a\n template\n \nFIELDS:\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t\n Specification of the desired behavior of the pod. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n\n\n" + "explain-template": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: template \n\nDESCRIPTION:\n Template describes the pods that will be created. The only allowed\n template.spec.restartPolicy value is \"Always\".\n PodTemplateSpec describes the data a pod should have when created from a\n template\n \nFIELDS:\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t\n Specification of the desired behavior of the pod. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n\n\n", + "explain-spec": "GROUP: apps\nKIND: Deployment\nVERSION: v1\n\nFIELD: spec \n\nDESCRIPTION:\n Specification of the desired behavior of the Deployment.\n DeploymentSpec is the specification of the desired behavior of the\n Deployment.\n \nFIELDS:\n minReadySeconds\t\n Minimum number of seconds for which a newly created pod should be ready\n without any of its container crashing, for it to be considered available.\n Defaults to 0 (pod will be considered available as soon as it is ready)\n\n paused\t\n Indicates that the deployment is paused.\n\n progressDeadlineSeconds\t\n The maximum time in seconds for a deployment to make progress before it is\n considered to be failed. The deployment controller will continue to process\n failed deployments and a condition with a ProgressDeadlineExceeded reason\n will be surfaced in the deployment status. Note that progress will not be\n estimated during the time a deployment is paused. Defaults to 600s.\n\n replicas\t\n Number of desired pods. This is a pointer to distinguish between explicit\n zero and not specified. Defaults to 1.\n\n revisionHistoryLimit\t\n The number of old ReplicaSets to retain to allow rollback. This is a pointer\n to distinguish between explicit zero and not specified. Defaults to 10.\n\n selector\t -required-\n Label selector for pods. Existing ReplicaSets whose pods are selected by\n this will be the ones affected by this deployment. It must match the pod\n template's labels.\n\n strategy\t\n The deployment strategy to use to replace existing pods with new ones.\n\n template\t -required-\n Template describes the pods that will be created. The only allowed\n template.spec.restartPolicy value is \"Always\".\n\n\n" } diff --git a/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_debug.json b/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_debug.json new file mode 100644 index 0000000000..b3283147eb --- /dev/null +++ b/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_debug.json @@ -0,0 +1,6 @@ +{ + "explain": "GROUP: operator.openshift.io\nKIND: ImageContentSourcePolicy\nVERSION: v1alpha1\n\nDESCRIPTION:\n ImageContentSourcePolicy holds cluster-wide information about how to handle\n registry mirror rules. When multiple policies are defined, the outcome of\n the behavior is defined on each field. \n Compatibility level 4: No compatibility is provided, the API can change at\n any point for any reason. These capabilities should not be used by\n applications needing long term support.\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t -required-\n spec holds user settable values for configuration\n\n\n", + "namespace": "0\n", + "explain-spec": "GROUP: operator.openshift.io\nKIND: ImageContentSourcePolicy\nVERSION: v1alpha1\n\nFIELD: spec \n\nDESCRIPTION:\n spec holds user settable values for configuration\n \nFIELDS:\n repositoryDigestMirrors\t<[]Object>\n repositoryDigestMirrors allows images referenced by image digests in pods to\n be pulled from alternative mirrored repository locations. The image pull\n specification provided to the pod will be compared to the source locations\n described in RepositoryDigestMirrors and the image may be pulled down from\n any of the mirrors in the list instead of the specified repository allowing\n administrators to choose a potentially faster mirror. Only image pull\n specifications that have an image digest will have this behavior applied to\n them - tags will continue to be pulled from the specified repository in the\n pull spec. \n Each \u201csource\u201d repository is treated independently; configurations for\n different \u201csource\u201d repositories don\u2019t interact. \n When multiple policies are defined for the same \u201csource\u201d repository, the\n sets of defined mirrors will be merged together, preserving the relative\n order of the mirrors, if possible. For example, if policy A has mirrors `a,\n b, c` and policy B has mirrors `c, d, e`, the mirrors will be used in the\n order `a, b, c, d, e`. If the orders of mirror entries conflict (e.g. `a,\n b` vs. `b, a`) the configuration is not rejected but the resulting order is\n unspecified.\n\n\n", + "explain-repositoryDigestMirrors": "GROUP: operator.openshift.io\nKIND: ImageContentSourcePolicy\nVERSION: v1alpha1\n\nFIELD: repositoryDigestMirrors <[]Object>\n\nDESCRIPTION:\n repositoryDigestMirrors allows images referenced by image digests in pods to\n be pulled from alternative mirrored repository locations. The image pull\n specification provided to the pod will be compared to the source locations\n described in RepositoryDigestMirrors and the image may be pulled down from\n any of the mirrors in the list instead of the specified repository allowing\n administrators to choose a potentially faster mirror. Only image pull\n specifications that have an image digest will have this behavior applied to\n them - tags will continue to be pulled from the specified repository in the\n pull spec. \n Each \u201csource\u201d repository is treated independently; configurations for\n different \u201csource\u201d repositories don\u2019t interact. \n When multiple policies are defined for the same \u201csource\u201d repository, the\n sets of defined mirrors will be merged together, preserving the relative\n order of the mirrors, if possible. For example, if policy A has mirrors `a,\n b, c` and policy B has mirrors `c, d, e`, the mirrors will be used in the\n order `a, b, c, d, e`. If the orders of mirror entries conflict (e.g. `a,\n b` vs. `b, a`) the configuration is not rejected but the resulting order is\n unspecified.\n RepositoryDigestMirrors holds cluster-wide information about how to handle\n mirros in the registries config. Note: the mirrors only work when pulling\n the images that are referenced by their digests.\n \nFIELDS:\n mirrors\t<[]string>\n mirrors is one or more repositories that may also contain the same images.\n The order of mirrors in this list is treated as the user's desired priority,\n while source is by default considered lower priority than all mirrors. Other\n cluster configuration, including (but not limited to) other\n repositoryDigestMirrors objects, may impact the exact order mirrors are\n contacted in, or some mirrors may be contacted in parallel, so this should\n be considered a preference rather than a guarantee of ordering.\n\n source\t -required-\n source is the repository that users refer to, e.g. in image pull\n specifications.\n\n\n" +} diff --git a/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_res.py b/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_res.py new file mode 100644 index 0000000000..90af115aad --- /dev/null +++ b/class_generator/tests/manifests/image_content_source_policy/image_content_source_policy_res.py @@ -0,0 +1,75 @@ +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, List, Optional +from ocp_resources.resource import Resource + + +class ImageContentSourcePolicy(Resource): + """ + ImageContentSourcePolicy holds cluster-wide information about how to handle + registry mirror rules. When multiple policies are defined, the outcome of + the behavior is defined on each field. + Compatibility level 4: No compatibility is provided, the API can change at + any point for any reason. These capabilities should not be used by + applications needing long term support. + """ + + api_group: str = Resource.ApiGroup.OPERATOR_OPENSHIFT_IO + + def __init__( + self, + repository_digest_mirrors: Optional[List[Any]] = None, + **kwargs: Any, + ) -> None: + """ + Args: + repository_digest_mirrors(List[Any]): repositoryDigestMirrors allows images referenced by image digests in pods to + be pulled from alternative mirrored repository locations. The image pull + specification provided to the pod will be compared to the source locations + described in RepositoryDigestMirrors and the image may be pulled down from + any of the mirrors in the list instead of the specified repository allowing + administrators to choose a potentially faster mirror. Only image pull + specifications that have an image digest will have this behavior applied to + them - tags will continue to be pulled from the specified repository in the + pull spec. + Each “source” repository is treated independently; configurations for + different “source” repositories don’t interact. + When multiple policies are defined for the same “source” repository, the + sets of defined mirrors will be merged together, preserving the relative + order of the mirrors, if possible. For example, if policy A has mirrors `a, + b, c` and policy B has mirrors `c, d, e`, the mirrors will be used in the + order `a, b, c, d, e`. If the orders of mirror entries conflict (e.g. `a, + b` vs. `b, a`) the configuration is not rejected but the resulting order is + unspecified. + RepositoryDigestMirrors holds cluster-wide information about how to handle + mirros in the registries config. Note: the mirrors only work when pulling + the images that are referenced by their digests. + + FIELDS: + mirrors <[]string> + mirrors is one or more repositories that may also contain the same images. + The order of mirrors in this list is treated as the user's desired priority, + while source is by default considered lower priority than all mirrors. Other + cluster configuration, including (but not limited to) other + repositoryDigestMirrors objects, may impact the exact order mirrors are + contacted in, or some mirrors may be contacted in parallel, so this should + be considered a preference rather than a guarantee of ordering. + + source -required- + source is the repository that users refer to, e.g. in image pull + specifications. + + """ + super().__init__(**kwargs) + + self.repository_digest_mirrors = repository_digest_mirrors + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + self.res["spec"] = {} + _spec = self.res["spec"] + + if self.repository_digest_mirrors: + _spec["repositoryDigestMirrors"] = self.repository_digest_mirrors diff --git a/class_generator/tests/manifests/pod/pod_debug.json b/class_generator/tests/manifests/pod/pod_debug.json index 2184568fdc..6bda2a88e1 100644 --- a/class_generator/tests/manifests/pod/pod_debug.json +++ b/class_generator/tests/manifests/pod/pod_debug.json @@ -1,5 +1,5 @@ { - "explain": "KIND: Pod\nVERSION: v1\n\nDESCRIPTION:\n Pod is a collection of containers that can run on a host. This resource is\n created by clients and scheduled onto hosts.\n \nFIELDS:\n apiVersion\t\n kind\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t\n activeDeadlineSeconds\t\n affinity\t\n nodeAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]PreferredSchedulingTerm>\n preference\t -required-\n matchExpressions\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchFields\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t\n nodeSelectorTerms\t<[]NodeSelectorTerm> -required-\n matchExpressions\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchFields\t<[]NodeSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n podAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]WeightedPodAffinityTerm>\n podAffinityTerm\t -required-\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t<[]PodAffinityTerm>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n podAntiAffinity\t\n preferredDuringSchedulingIgnoredDuringExecution\t<[]WeightedPodAffinityTerm>\n podAffinityTerm\t -required-\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n weight\t -required-\n requiredDuringSchedulingIgnoredDuringExecution\t<[]PodAffinityTerm>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n mismatchLabelKeys\t<[]string>\n namespaceSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n namespaces\t<[]string>\n topologyKey\t -required-\n automountServiceAccountToken\t\n containers\t<[]Container> -required-\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n dnsConfig\t\n nameservers\t<[]string>\n options\t<[]PodDNSConfigOption>\n name\t\n value\t\n searches\t<[]string>\n dnsPolicy\t\n enableServiceLinks\t\n ephemeralContainers\t<[]EphemeralContainer>\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n targetContainerName\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n hostAliases\t<[]HostAlias>\n hostnames\t<[]string>\n ip\t -required-\n hostIPC\t\n hostNetwork\t\n hostPID\t\n hostUsers\t\n hostname\t\n imagePullSecrets\t<[]LocalObjectReference>\n name\t\n initContainers\t<[]Container>\n args\t<[]string>\n command\t<[]string>\n env\t<[]EnvVar>\n name\t -required-\n value\t\n valueFrom\t\n configMapKeyRef\t\n key\t -required-\n name\t\n optional\t\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secretKeyRef\t\n key\t -required-\n name\t\n optional\t\n envFrom\t<[]EnvFromSource>\n configMapRef\t\n name\t\n optional\t\n prefix\t\n secretRef\t\n name\t\n optional\t\n image\t\n imagePullPolicy\t\n lifecycle\t\n postStart\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n preStop\t\n exec\t\n command\t<[]string>\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n sleep\t\n seconds\t -required-\n tcpSocket\t\n host\t\n port\t -required-\n livenessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n name\t -required-\n ports\t<[]ContainerPort>\n containerPort\t -required-\n hostIP\t\n hostPort\t\n name\t\n protocol\t\n readinessProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n resizePolicy\t<[]ContainerResizePolicy>\n resourceName\t -required-\n restartPolicy\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartPolicy\t\n securityContext\t\n allowPrivilegeEscalation\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n capabilities\t\n add\t<[]string>\n drop\t<[]string>\n privileged\t\n procMount\t\n readOnlyRootFilesystem\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n startupProbe\t\n exec\t\n command\t<[]string>\n failureThreshold\t\n grpc\t\n port\t -required-\n service\t\n httpGet\t\n host\t\n httpHeaders\t<[]HTTPHeader>\n name\t -required-\n value\t -required-\n path\t\n port\t -required-\n scheme\t\n initialDelaySeconds\t\n periodSeconds\t\n successThreshold\t\n tcpSocket\t\n host\t\n port\t -required-\n terminationGracePeriodSeconds\t\n timeoutSeconds\t\n stdin\t\n stdinOnce\t\n terminationMessagePath\t\n terminationMessagePolicy\t\n tty\t\n volumeDevices\t<[]VolumeDevice>\n devicePath\t -required-\n name\t -required-\n volumeMounts\t<[]VolumeMount>\n mountPath\t -required-\n mountPropagation\t\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n subPath\t\n subPathExpr\t\n workingDir\t\n nodeName\t\n nodeSelector\t\n os\t\n name\t -required-\n overhead\t\n preemptionPolicy\t\n priority\t\n priorityClassName\t\n readinessGates\t<[]PodReadinessGate>\n conditionType\t -required-\n resourceClaims\t<[]PodResourceClaim>\n name\t -required-\n source\t\n resourceClaimName\t\n resourceClaimTemplateName\t\n restartPolicy\t\n runtimeClassName\t\n schedulerName\t\n schedulingGates\t<[]PodSchedulingGate>\n name\t -required-\n securityContext\t\n appArmorProfile\t\n localhostProfile\t\n type\t -required-\n fsGroup\t\n fsGroupChangePolicy\t\n runAsGroup\t\n runAsNonRoot\t\n runAsUser\t\n seLinuxOptions\t\n level\t\n role\t\n type\t\n user\t\n seccompProfile\t\n localhostProfile\t\n type\t -required-\n supplementalGroups\t<[]integer>\n sysctls\t<[]Sysctl>\n name\t -required-\n value\t -required-\n windowsOptions\t\n gmsaCredentialSpec\t\n gmsaCredentialSpecName\t\n hostProcess\t\n runAsUserName\t\n serviceAccount\t\n serviceAccountName\t\n setHostnameAsFQDN\t\n shareProcessNamespace\t\n subdomain\t\n terminationGracePeriodSeconds\t\n tolerations\t<[]Toleration>\n effect\t\n key\t\n operator\t\n tolerationSeconds\t\n value\t\n topologySpreadConstraints\t<[]TopologySpreadConstraint>\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n matchLabelKeys\t<[]string>\n maxSkew\t -required-\n minDomains\t\n nodeAffinityPolicy\t\n nodeTaintsPolicy\t\n topologyKey\t -required-\n whenUnsatisfiable\t -required-\n volumes\t<[]Volume>\n awsElasticBlockStore\t\n fsType\t\n partition\t\n readOnly\t\n volumeID\t -required-\n azureDisk\t\n cachingMode\t\n diskName\t -required-\n diskURI\t -required-\n fsType\t\n kind\t\n readOnly\t\n azureFile\t\n readOnly\t\n secretName\t -required-\n shareName\t -required-\n cephfs\t\n monitors\t<[]string> -required-\n path\t\n readOnly\t\n secretFile\t\n secretRef\t\n name\t\n user\t\n cinder\t\n fsType\t\n readOnly\t\n secretRef\t\n name\t\n volumeID\t -required-\n configMap\t\n defaultMode\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n csi\t\n driver\t -required-\n fsType\t\n nodePublishSecretRef\t\n name\t\n readOnly\t\n volumeAttributes\t\n downwardAPI\t\n defaultMode\t\n items\t<[]DownwardAPIVolumeFile>\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n mode\t\n path\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n emptyDir\t\n medium\t\n sizeLimit\t\n ephemeral\t\n volumeClaimTemplate\t\n metadata\t\n annotations\t\n creationTimestamp\t\n deletionGracePeriodSeconds\t\n deletionTimestamp\t\n finalizers\t<[]string>\n generateName\t\n generation\t\n labels\t\n managedFields\t<[]ManagedFieldsEntry>\n apiVersion\t\n fieldsType\t\n fieldsV1\t\n manager\t\n operation\t\n subresource\t\n time\t\n name\t\n namespace\t\n ownerReferences\t<[]OwnerReference>\n apiVersion\t -required-\n blockOwnerDeletion\t\n controller\t\n kind\t -required-\n name\t -required-\n uid\t -required-\n resourceVersion\t\n selfLink\t\n uid\t\n spec\t -required-\n accessModes\t<[]string>\n dataSource\t\n apiGroup\t\n kind\t -required-\n name\t -required-\n dataSourceRef\t\n apiGroup\t\n kind\t -required-\n name\t -required-\n namespace\t\n resources\t\n limits\t\n requests\t\n selector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n storageClassName\t\n volumeAttributesClassName\t\n volumeMode\t\n volumeName\t\n fc\t\n fsType\t\n lun\t\n readOnly\t\n targetWWNs\t<[]string>\n wwids\t<[]string>\n flexVolume\t\n driver\t -required-\n fsType\t\n options\t\n readOnly\t\n secretRef\t\n name\t\n flocker\t\n datasetName\t\n datasetUUID\t\n gcePersistentDisk\t\n fsType\t\n partition\t\n pdName\t -required-\n readOnly\t\n gitRepo\t\n directory\t\n repository\t -required-\n revision\t\n glusterfs\t\n endpoints\t -required-\n path\t -required-\n readOnly\t\n hostPath\t\n path\t -required-\n type\t\n iscsi\t\n chapAuthDiscovery\t\n chapAuthSession\t\n fsType\t\n initiatorName\t\n iqn\t -required-\n iscsiInterface\t\n lun\t -required-\n portals\t<[]string>\n readOnly\t\n secretRef\t\n name\t\n targetPortal\t -required-\n name\t -required-\n nfs\t\n path\t -required-\n readOnly\t\n server\t -required-\n persistentVolumeClaim\t\n claimName\t -required-\n readOnly\t\n photonPersistentDisk\t\n fsType\t\n pdID\t -required-\n portworxVolume\t\n fsType\t\n readOnly\t\n volumeID\t -required-\n projected\t\n defaultMode\t\n sources\t<[]VolumeProjection>\n clusterTrustBundle\t\n labelSelector\t\n matchExpressions\t<[]LabelSelectorRequirement>\n key\t -required-\n operator\t -required-\n values\t<[]string>\n matchLabels\t\n name\t\n optional\t\n path\t -required-\n signerName\t\n configMap\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n downwardAPI\t\n items\t<[]DownwardAPIVolumeFile>\n fieldRef\t\n apiVersion\t\n fieldPath\t -required-\n mode\t\n path\t -required-\n resourceFieldRef\t\n containerName\t\n divisor\t\n resource\t -required-\n secret\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n name\t\n optional\t\n serviceAccountToken\t\n audience\t\n expirationSeconds\t\n path\t -required-\n quobyte\t\n group\t\n readOnly\t\n registry\t -required-\n tenant\t\n user\t\n volume\t -required-\n rbd\t\n fsType\t\n image\t -required-\n keyring\t\n monitors\t<[]string> -required-\n pool\t\n readOnly\t\n secretRef\t\n name\t\n user\t\n scaleIO\t\n fsType\t\n gateway\t -required-\n protectionDomain\t\n readOnly\t\n secretRef\t -required-\n name\t\n sslEnabled\t\n storageMode\t\n storagePool\t\n system\t -required-\n volumeName\t\n secret\t\n defaultMode\t\n items\t<[]KeyToPath>\n key\t -required-\n mode\t\n path\t -required-\n optional\t\n secretName\t\n storageos\t\n fsType\t\n readOnly\t\n secretRef\t\n name\t\n volumeName\t\n volumeNamespace\t\n vsphereVolume\t\n fsType\t\n storagePolicyID\t\n storagePolicyName\t\n volumePath\t -required-\n status\t\n conditions\t<[]PodCondition>\n lastProbeTime\t\n lastTransitionTime\t\n message\t\n reason\t\n status\t -required-\n type\t -required-\n containerStatuses\t<[]ContainerStatus>\n allocatedResources\t\n containerID\t\n image\t -required-\n imageID\t -required-\n lastState\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n name\t -required-\n ready\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartCount\t -required-\n started\t\n state\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n volumeMounts\t<[]VolumeMountStatus>\n mountPath\t -required-\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n ephemeralContainerStatuses\t<[]ContainerStatus>\n allocatedResources\t\n containerID\t\n image\t -required-\n imageID\t -required-\n lastState\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n name\t -required-\n ready\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartCount\t -required-\n started\t\n state\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n volumeMounts\t<[]VolumeMountStatus>\n mountPath\t -required-\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n hostIP\t\n hostIPs\t<[]HostIP>\n ip\t\n initContainerStatuses\t<[]ContainerStatus>\n allocatedResources\t\n containerID\t\n image\t -required-\n imageID\t -required-\n lastState\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n name\t -required-\n ready\t -required-\n resources\t\n claims\t<[]ResourceClaim>\n name\t -required-\n limits\t\n requests\t\n restartCount\t -required-\n started\t\n state\t\n running\t\n startedAt\t\n terminated\t\n containerID\t\n exitCode\t -required-\n finishedAt\t\n message\t\n reason\t\n signal\t\n startedAt\t\n waiting\t\n message\t\n reason\t\n volumeMounts\t<[]VolumeMountStatus>\n mountPath\t -required-\n name\t -required-\n readOnly\t\n recursiveReadOnly\t\n message\t\n nominatedNodeName\t\n phase\t\n podIP\t\n podIPs\t<[]PodIP>\n ip\t\n qosClass\t\n reason\t\n resize\t\n resourceClaimStatuses\t<[]PodResourceClaimStatus>\n name\t -required-\n resourceClaimName\t\n startTime\t\n\n", + "explain": "KIND: Pod\nVERSION: v1\n\nDESCRIPTION:\n Pod is a collection of containers that can run on a host. This resource is\n created by clients and scheduled onto hosts.\n \nFIELDS:\n apiVersion\t\n APIVersion defines the versioned schema of this representation of an object.\n Servers should convert recognized schemas to the latest internal value, and\n may reject unrecognized values. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources\n\n kind\t\n Kind is a string value representing the REST resource this object\n represents. Servers may infer this from the endpoint the client submits\n requests to. Cannot be updated. In CamelCase. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n\n metadata\t\n Standard object's metadata. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\n\n spec\t\n Specification of the desired behavior of the pod. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n\n status\t\n Most recently observed status of the pod. This data may not be up to date.\n Populated by the system. Read-only. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n\n\n", "namespace": "1\n", "explain-activeDeadlineSeconds": "KIND: Pod\nVERSION: v1\n\nFIELD: activeDeadlineSeconds \n\nDESCRIPTION:\n Optional duration in seconds the pod may be active on the node relative to\n StartTime before the system will actively try to mark it failed and kill\n associated containers. Value must be a positive integer.\n \n\n", "explain-affinity": "KIND: Pod\nVERSION: v1\n\nFIELD: affinity \n\nDESCRIPTION:\n If specified, the pod's scheduling constraints\n Affinity is a group of affinity scheduling rules.\n \nFIELDS:\n nodeAffinity\t\n Describes node affinity scheduling rules for the pod.\n\n podAffinity\t\n Describes pod affinity scheduling rules (e.g. co-locate this pod in the same\n node, zone, etc. as some other pod(s)).\n\n podAntiAffinity\t\n Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in\n the same node, zone, etc. as some other pod(s)).\n\n\n", @@ -9,17 +9,17 @@ "explain-dnsPolicy": "KIND: Pod\nVERSION: v1\n\nFIELD: dnsPolicy \n\nDESCRIPTION:\n Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are\n 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS\n parameters given in DNSConfig will be merged with the policy selected with\n DNSPolicy. To have DNS options set along with hostNetwork, you have to\n specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n \n Possible enum values:\n - `\"ClusterFirst\"` indicates that the pod should use cluster DNS first\n unless hostNetwork is true, if it is available, then fall back on the\n default (as determined by kubelet) DNS settings.\n - `\"ClusterFirstWithHostNet\"` indicates that the pod should use cluster DNS\n first, if it is available, then fall back on the default (as determined by\n kubelet) DNS settings.\n - `\"Default\"` indicates that the pod should use the default (as determined\n by kubelet) DNS settings.\n - `\"None\"` indicates that the pod should use empty DNS settings. DNS\n parameters such as nameservers and search paths should be defined via\n DNSConfig.\n \n\n", "explain-enableServiceLinks": "KIND: Pod\nVERSION: v1\n\nFIELD: enableServiceLinks \n\nDESCRIPTION:\n EnableServiceLinks indicates whether information about services should be\n injected into pod's environment variables, matching the syntax of Docker\n links. Optional: Defaults to true.\n \n\n", "explain-ephemeralContainers": "KIND: Pod\nVERSION: v1\n\nFIELD: ephemeralContainers <[]EphemeralContainer>\n\nDESCRIPTION:\n List of ephemeral containers run in this pod. Ephemeral containers may be\n run in an existing pod to perform user-initiated actions such as debugging.\n This list cannot be specified when creating a pod, and it cannot be modified\n by updating the pod spec. In order to add an ephemeral container to an\n existing pod, use the pod's ephemeralcontainers subresource.\n An EphemeralContainer is a temporary container that you may add to an\n existing Pod for user-initiated activities such as debugging. Ephemeral\n containers have no resource or scheduling guarantees, and they will not be\n restarted when they exit or when a Pod is removed or restarted. The kubelet\n may evict a Pod if an ephemeral container causes the Pod to exceed its\n resource allocation.\n \n To add an ephemeral container, use the ephemeralcontainers subresource of an\n existing Pod. Ephemeral containers may not be removed or restarted.\n \nFIELDS:\n args\t<[]string>\n Arguments to the entrypoint. The image's CMD is used if this is not\n provided. Variable references $(VAR_NAME) are expanded using the container's\n environment. If a variable cannot be resolved, the reference in the input\n string will be unchanged. Double $$ are reduced to a single $, which allows\n for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the\n string literal \"$(VAR_NAME)\". Escaped references will never be expanded,\n regardless of whether the variable exists or not. Cannot be updated. More\n info:\n https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\n\n command\t<[]string>\n Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is\n used if this is not provided. Variable references $(VAR_NAME) are expanded\n using the container's environment. If a variable cannot be resolved, the\n reference in the input string will be unchanged. Double $$ are reduced to a\n single $, which allows for escaping the $(VAR_NAME) syntax: i.e.\n \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped\n references will never be expanded, regardless of whether the variable exists\n or not. Cannot be updated. More info:\n https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\n\n env\t<[]EnvVar>\n List of environment variables to set in the container. Cannot be updated.\n\n envFrom\t<[]EnvFromSource>\n List of sources to populate environment variables in the container. The keys\n defined within a source must be a C_IDENTIFIER. All invalid keys will be\n reported as an event when the container is starting. When a key exists in\n multiple sources, the value associated with the last source will take\n precedence. Values defined by an Env with a duplicate key will take\n precedence. Cannot be updated.\n\n image\t\n Container image name. More info:\n https://kubernetes.io/docs/concepts/containers/images\n\n imagePullPolicy\t\n Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if\n :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More\n info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n \n Possible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image.\n Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on\n disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local\n image. Container will fail if the image isn't present\n\n lifecycle\t\n Lifecycle is not allowed for ephemeral containers.\n\n livenessProbe\t\n Probes are not allowed for ephemeral containers.\n\n name\t -required-\n Name of the ephemeral container specified as a DNS_LABEL. This name must be\n unique among all containers, init containers and ephemeral containers.\n\n ports\t<[]ContainerPort>\n Ports are not allowed for ephemeral containers.\n\n readinessProbe\t\n Probes are not allowed for ephemeral containers.\n\n resizePolicy\t<[]ContainerResizePolicy>\n Resources resize policy for the container.\n\n resources\t\n Resources are not allowed for ephemeral containers. Ephemeral containers use\n spare resources already allocated to the pod.\n\n restartPolicy\t\n Restart policy for the container to manage the restart behavior of each\n container within a pod. This may only be set for init containers. You cannot\n set this field on ephemeral containers.\n\n securityContext\t\n Optional: SecurityContext defines the security options the ephemeral\n container should be run with. If set, the fields of SecurityContext override\n the equivalent fields of PodSecurityContext.\n\n startupProbe\t\n Probes are not allowed for ephemeral containers.\n\n stdin\t\n Whether this container should allocate a buffer for stdin in the container\n runtime. If this is not set, reads from stdin in the container will always\n result in EOF. Default is false.\n\n stdinOnce\t\n Whether the container runtime should close the stdin channel after it has\n been opened by a single attach. When stdin is true the stdin stream will\n remain open across multiple attach sessions. If stdinOnce is set to true,\n stdin is opened on container start, is empty until the first client attaches\n to stdin, and then remains open and accepts data until the client\n disconnects, at which time stdin is closed and remains closed until the\n container is restarted. If this flag is false, a container processes that\n reads from stdin will never receive an EOF. Default is false\n\n targetContainerName\t\n If set, the name of the container from PodSpec that this ephemeral container\n targets. The ephemeral container will be run in the namespaces (IPC, PID,\n etc) of this container. If not set then the ephemeral container uses the\n namespaces configured in the Pod spec.\n \n The container runtime must implement support for this feature. If the\n runtime does not support namespace targeting then the result of setting this\n field is undefined.\n\n terminationMessagePath\t\n Optional: Path at which the file to which the container's termination\n message will be written is mounted into the container's filesystem. Message\n written is intended to be brief final status, such as an assertion failure\n message. Will be truncated by the node if greater than 4096 bytes. The total\n message length across all containers will be limited to 12kb. Defaults to\n /dev/termination-log. Cannot be updated.\n\n terminationMessagePolicy\t\n Indicate how the termination message should be populated. File will use the\n contents of terminationMessagePath to populate the container status message\n on both success and failure. FallbackToLogsOnError will use the last chunk\n of container log output if the termination message file is empty and the\n container exited with an error. The log output is limited to 2048 bytes or\n 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n \n Possible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the\n container logs for the container status message when the container exits\n with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status\n message to the contents of the container's terminationMessagePath when the\n container exits.\n\n tty\t\n Whether this container should allocate a TTY for itself, also requires\n 'stdin' to be true. Default is false.\n\n volumeDevices\t<[]VolumeDevice>\n volumeDevices is the list of block devices to be used by the container.\n\n volumeMounts\t<[]VolumeMount>\n Pod volumes to mount into the container's filesystem. Subpath mounts are not\n allowed for ephemeral containers. Cannot be updated.\n\n workingDir\t\n Container's working directory. If not specified, the container runtime's\n default will be used, which might be configured in the container image.\n Cannot be updated.\n\n\n", - "explain-hostAliases": "KIND: Pod\nVERSION: v1\n\nFIELD: hostAliases <[]HostAlias>\n\nDESCRIPTION:\n HostAliases is an optional list of hosts and IPs that will be injected into\n the pod's hosts file if specified.\n HostAlias holds the mapping between IP and hostnames that will be injected\n as an entry in the pod's hosts file.\n \nFIELDS:\n hostnames\t<[]string>\n Hostnames for the above IP address.\n\n ip\t -required-\n IP address of the host file entry.\n\n\n", + "explain-hostAliases": "KIND: Pod\nVERSION: v1\n\nFIELD: hostAliases <[]HostAlias>\n\nDESCRIPTION:\n HostAliases is an optional list of hosts and IPs that will be injected into\n the pod's hosts file if specified. This is only valid for non-hostNetwork\n pods.\n HostAlias holds the mapping between IP and hostnames that will be injected\n as an entry in the pod's hosts file.\n \nFIELDS:\n hostnames\t<[]string>\n Hostnames for the above IP address.\n\n ip\t\n IP address of the host file entry.\n\n\n", "explain-hostIPC": "KIND: Pod\nVERSION: v1\n\nFIELD: hostIPC \n\nDESCRIPTION:\n Use the host's ipc namespace. Optional: Default to false.\n \n\n", "explain-hostNetwork": "KIND: Pod\nVERSION: v1\n\nFIELD: hostNetwork \n\nDESCRIPTION:\n Host networking requested for this pod. Use the host's network namespace. If\n this option is set, the ports that will be used must be specified. Default\n to false.\n \n\n", "explain-hostPID": "KIND: Pod\nVERSION: v1\n\nFIELD: hostPID \n\nDESCRIPTION:\n Use the host's pid namespace. Optional: Default to false.\n \n\n", "explain-hostUsers": "KIND: Pod\nVERSION: v1\n\nFIELD: hostUsers \n\nDESCRIPTION:\n Use the host's user namespace. Optional: Default to true. If set to true or\n not present, the pod will be run in the host user namespace, useful for when\n the pod needs a feature only available to the host user namespace, such as\n loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns\n is created for the pod. Setting false is useful for mitigating container\n breakout vulnerabilities even allowing users to run their containers as root\n without actually having root privileges on the host. This field is\n alpha-level and is only honored by servers that enable the\n UserNamespacesSupport feature.\n \n\n", "explain-hostname": "KIND: Pod\nVERSION: v1\n\nFIELD: hostname \n\nDESCRIPTION:\n Specifies the hostname of the Pod If not specified, the pod's hostname will\n be set to a system-defined value.\n \n\n", - "explain-imagePullSecrets": "KIND: Pod\nVERSION: v1\n\nFIELD: imagePullSecrets <[]LocalObjectReference>\n\nDESCRIPTION:\n ImagePullSecrets is an optional list of references to secrets in the same\n namespace to use for pulling any of the images used by this PodSpec. If\n specified, these secrets will be passed to individual puller implementations\n for them to use. More info:\n https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n LocalObjectReference contains enough information to let you locate the\n referenced object inside the same namespace.\n \nFIELDS:\n name\t\n Name of the referent. This field is effectively required, but due to\n backwards compatibility is allowed to be empty. Instances of this type with\n an empty value here are almost certainly wrong. More info:\n https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n\n\n", + "explain-imagePullSecrets": "KIND: Pod\nVERSION: v1\n\nFIELD: imagePullSecrets <[]LocalObjectReference>\n\nDESCRIPTION:\n ImagePullSecrets is an optional list of references to secrets in the same\n namespace to use for pulling any of the images used by this PodSpec. If\n specified, these secrets will be passed to individual puller implementations\n for them to use. More info:\n https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n LocalObjectReference contains enough information to let you locate the\n referenced object inside the same namespace.\n \nFIELDS:\n name\t\n Name of the referent. More info:\n https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n\n\n", "explain-initContainers": "KIND: Pod\nVERSION: v1\n\nFIELD: initContainers <[]Container>\n\nDESCRIPTION:\n List of initialization containers belonging to the pod. Init containers are\n executed in order prior to containers being started. If any init container\n fails, the pod is considered to have failed and is handled according to its\n restartPolicy. The name for an init container or normal container must be\n unique among all containers. Init containers may not have Lifecycle actions,\n Readiness probes, Liveness probes, or Startup probes. The\n resourceRequirements of an init container are taken into account during\n scheduling by finding the highest request/limit for each resource type, and\n then using the max of of that value or the sum of the normal containers.\n Limits are applied to init containers in a similar fashion. Init containers\n cannot currently be added or removed. Cannot be updated. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/init-containers/\n A single application container that you want to run within a pod.\n \nFIELDS:\n args\t<[]string>\n Arguments to the entrypoint. The container image's CMD is used if this is\n not provided. Variable references $(VAR_NAME) are expanded using the\n container's environment. If a variable cannot be resolved, the reference in\n the input string will be unchanged. Double $$ are reduced to a single $,\n which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will\n produce the string literal \"$(VAR_NAME)\". Escaped references will never be\n expanded, regardless of whether the variable exists or not. Cannot be\n updated. More info:\n https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\n\n command\t<[]string>\n Entrypoint array. Not executed within a shell. The container image's\n ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME)\n are expanded using the container's environment. If a variable cannot be\n resolved, the reference in the input string will be unchanged. Double $$ are\n reduced to a single $, which allows for escaping the $(VAR_NAME) syntax:\n i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped\n references will never be expanded, regardless of whether the variable exists\n or not. Cannot be updated. More info:\n https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\n\n env\t<[]EnvVar>\n List of environment variables to set in the container. Cannot be updated.\n\n envFrom\t<[]EnvFromSource>\n List of sources to populate environment variables in the container. The keys\n defined within a source must be a C_IDENTIFIER. All invalid keys will be\n reported as an event when the container is starting. When a key exists in\n multiple sources, the value associated with the last source will take\n precedence. Values defined by an Env with a duplicate key will take\n precedence. Cannot be updated.\n\n image\t\n Container image name. More info:\n https://kubernetes.io/docs/concepts/containers/images This field is optional\n to allow higher level config management to default or override container\n images in workload controllers like Deployments and StatefulSets.\n\n imagePullPolicy\t\n Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if\n :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More\n info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n \n Possible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image.\n Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on\n disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local\n image. Container will fail if the image isn't present\n\n lifecycle\t\n Actions that the management system should take in response to container\n lifecycle events. Cannot be updated.\n\n livenessProbe\t\n Periodic probe of container liveness. Container will be restarted if the\n probe fails. Cannot be updated. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n\n name\t -required-\n Name of the container specified as a DNS_LABEL. Each container in a pod must\n have a unique name (DNS_LABEL). Cannot be updated.\n\n ports\t<[]ContainerPort>\n List of ports to expose from the container. Not specifying a port here DOES\n NOT prevent that port from being exposed. Any port which is listening on the\n default \"0.0.0.0\" address inside a container will be accessible from the\n network. Modifying this array with strategic merge patch may corrupt the\n data. For more information See\n https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.\n\n readinessProbe\t\n Periodic probe of container service readiness. Container will be removed\n from service endpoints if the probe fails. Cannot be updated. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n\n resizePolicy\t<[]ContainerResizePolicy>\n Resources resize policy for the container.\n\n resources\t\n Compute Resources required by this container. Cannot be updated. More info:\n https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\n\n restartPolicy\t\n RestartPolicy defines the restart behavior of individual containers in a\n pod. This field may only be set for init containers, and the only allowed\n value is \"Always\". For non-init containers or when this field is not\n specified, the restart behavior is defined by the Pod's restart policy and\n the container type. Setting the RestartPolicy as \"Always\" for the init\n container will have the following effect: this init container will be\n continually restarted on exit until all regular containers have terminated.\n Once all regular containers have completed, all init containers with\n restartPolicy \"Always\" will be shut down. This lifecycle differs from normal\n init containers and is often referred to as a \"sidecar\" container. Although\n this init container still starts in the init container sequence, it does not\n wait for the container to complete before proceeding to the next init\n container. Instead, the next init container starts immediately after this\n init container is started, or after any startupProbe has successfully\n completed.\n\n securityContext\t\n SecurityContext defines the security options the container should be run\n with. If set, the fields of SecurityContext override the equivalent fields\n of PodSecurityContext. More info:\n https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\n\n startupProbe\t\n StartupProbe indicates that the Pod has successfully initialized. If\n specified, no other probes are executed until this completes successfully.\n If this probe fails, the Pod will be restarted, just as if the livenessProbe\n failed. This can be used to provide different probe parameters at the\n beginning of a Pod's lifecycle, when it might take a long time to load data\n or warm a cache, than during steady-state operation. This cannot be updated.\n More info:\n https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n\n stdin\t\n Whether this container should allocate a buffer for stdin in the container\n runtime. If this is not set, reads from stdin in the container will always\n result in EOF. Default is false.\n\n stdinOnce\t\n Whether the container runtime should close the stdin channel after it has\n been opened by a single attach. When stdin is true the stdin stream will\n remain open across multiple attach sessions. If stdinOnce is set to true,\n stdin is opened on container start, is empty until the first client attaches\n to stdin, and then remains open and accepts data until the client\n disconnects, at which time stdin is closed and remains closed until the\n container is restarted. If this flag is false, a container processes that\n reads from stdin will never receive an EOF. Default is false\n\n terminationMessagePath\t\n Optional: Path at which the file to which the container's termination\n message will be written is mounted into the container's filesystem. Message\n written is intended to be brief final status, such as an assertion failure\n message. Will be truncated by the node if greater than 4096 bytes. The total\n message length across all containers will be limited to 12kb. Defaults to\n /dev/termination-log. Cannot be updated.\n\n terminationMessagePolicy\t\n Indicate how the termination message should be populated. File will use the\n contents of terminationMessagePath to populate the container status message\n on both success and failure. FallbackToLogsOnError will use the last chunk\n of container log output if the termination message file is empty and the\n container exited with an error. The log output is limited to 2048 bytes or\n 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n \n Possible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the\n container logs for the container status message when the container exits\n with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status\n message to the contents of the container's terminationMessagePath when the\n container exits.\n\n tty\t\n Whether this container should allocate a TTY for itself, also requires\n 'stdin' to be true. Default is false.\n\n volumeDevices\t<[]VolumeDevice>\n volumeDevices is the list of block devices to be used by the container.\n\n volumeMounts\t<[]VolumeMount>\n Pod volumes to mount into the container's filesystem. Cannot be updated.\n\n workingDir\t\n Container's working directory. If not specified, the container runtime's\n default will be used, which might be configured in the container image.\n Cannot be updated.\n\n\n", "explain-nodeName": "KIND: Pod\nVERSION: v1\n\nFIELD: nodeName \n\nDESCRIPTION:\n NodeName is a request to schedule this pod onto a specific node. If it is\n non-empty, the scheduler simply schedules this pod onto that node, assuming\n that it fits resource requirements.\n \n\n", "explain-nodeSelector": "KIND: Pod\nVERSION: v1\n\nFIELD: nodeSelector \n\nDESCRIPTION:\n NodeSelector is a selector which must be true for the pod to fit on a node.\n Selector which must match a node's labels for the pod to be scheduled on\n that node. More info:\n https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n \n\n", - "explain-os": "KIND: Pod\nVERSION: v1\n\nFIELD: os \n\nDESCRIPTION:\n Specifies the OS of the containers in the pod. Some pod and container fields\n are restricted if this is set.\n \n If the OS field is set to linux, the following fields must be unset:\n -securityContext.windowsOptions\n \n If the OS field is set to windows, following fields must be unset: -\n spec.hostPID - spec.hostIPC - spec.hostUsers -\n spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions -\n spec.securityContext.seccompProfile - spec.securityContext.fsGroup -\n spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls -\n spec.shareProcessNamespace - spec.securityContext.runAsUser -\n spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups -\n spec.containers[*].securityContext.appArmorProfile -\n spec.containers[*].securityContext.seLinuxOptions -\n spec.containers[*].securityContext.seccompProfile -\n spec.containers[*].securityContext.capabilities -\n spec.containers[*].securityContext.readOnlyRootFilesystem -\n spec.containers[*].securityContext.privileged -\n spec.containers[*].securityContext.allowPrivilegeEscalation -\n spec.containers[*].securityContext.procMount -\n spec.containers[*].securityContext.runAsUser -\n spec.containers[*].securityContext.runAsGroup\n PodOS defines the OS parameters of a pod.\n \nFIELDS:\n name\t -required-\n Name is the name of the operating system. The currently supported values are\n linux and windows. Additional value may be defined in future and can be one\n of:\n https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration\n Clients should expect to handle additional values and treat unrecognized\n values in this field as os: null\n\n\n", + "explain-os": "KIND: Pod\nVERSION: v1\n\nFIELD: os \n\nDESCRIPTION:\n Specifies the OS of the containers in the pod. Some pod and container fields\n are restricted if this is set.\n \n If the OS field is set to linux, the following fields must be unset:\n -securityContext.windowsOptions\n \n If the OS field is set to windows, following fields must be unset: -\n spec.hostPID - spec.hostIPC - spec.hostUsers -\n spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile -\n spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy -\n spec.securityContext.sysctls - spec.shareProcessNamespace -\n spec.securityContext.runAsUser - spec.securityContext.runAsGroup -\n spec.securityContext.supplementalGroups -\n spec.containers[*].securityContext.seLinuxOptions -\n spec.containers[*].securityContext.seccompProfile -\n spec.containers[*].securityContext.capabilities -\n spec.containers[*].securityContext.readOnlyRootFilesystem -\n spec.containers[*].securityContext.privileged -\n spec.containers[*].securityContext.allowPrivilegeEscalation -\n spec.containers[*].securityContext.procMount -\n spec.containers[*].securityContext.runAsUser -\n spec.containers[*].securityContext.runAsGroup\n PodOS defines the OS parameters of a pod.\n \nFIELDS:\n name\t -required-\n Name is the name of the operating system. The currently supported values are\n linux and windows. Additional value may be defined in future and can be one\n of:\n https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration\n Clients should expect to handle additional values and treat unrecognized\n values in this field as os: null\n\n\n", "explain-overhead": "KIND: Pod\nVERSION: v1\n\nFIELD: overhead \n\nDESCRIPTION:\n Overhead represents the resource overhead associated with running a pod for\n a given RuntimeClass. This field will be autopopulated at admission time by\n the RuntimeClass admission controller. If the RuntimeClass admission\n controller is enabled, overhead must not be set in Pod create requests. The\n RuntimeClass admission controller will reject Pod create requests which have\n the overhead already set. If RuntimeClass is configured and selected in the\n PodSpec, Overhead will be set to the value defined in the corresponding\n RuntimeClass, otherwise it will remain unset and treated as zero. More info:\n https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md\n Quantity is a fixed-point representation of a number. It provides convenient\n marshaling/unmarshaling in JSON and YAML, in addition to String() and\n AsInt64() accessors.\n \n The serialization format is:\n \n ``` ::= \n \n \t(Note that may be empty, from the \"\" case in .)\n \n ::= 0 | 1 | ... | 9 ::= |\n ::= | . |\n . | . ::= \"+\" | \"-\" ::=\n | ::= |\n | ::= Ki | Mi | Gi | Ti | Pi\n | Ei\n \n \t(International System of units; See:\n http://physics.nist.gov/cuu/Units/binary.html)\n \n ::= m | \"\" | k | M | G | T | P | E\n \n \t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n \n ::= \"e\" | \"E\" ```\n \n No matter which of the three exponent forms is used, no quantity may\n represent a number greater than 2^63-1 in magnitude, nor may it have more\n than 3 decimal places. Numbers larger or more precise will be capped or\n rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the\n future if we require larger or smaller quantities.\n \n When a Quantity is parsed from a string, it will remember the type of suffix\n it had, and will use the same type again when it is serialized.\n \n Before serializing, Quantity will be put in \"canonical form\". This means\n that Exponent/suffix will be adjusted up or down (with a corresponding\n increase or decrease in Mantissa) such that:\n \n - No precision is lost - No fractional digits will be emitted - The exponent\n (or suffix) is as large as possible.\n \n The sign will be omitted unless the number is negative.\n \n Examples:\n \n - 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n \n Note that the quantity will NEVER be internally represented by a floating\n point number. That is the whole point of this exercise.\n \n Non-canonical values will still parse as long as they are well formed, but\n will be re-emitted in their canonical form. (So always use canonical form,\n or don't diff.)\n \n This format is intended to make it difficult to use these numbers without\n writing some sort of special handling code in the hopes that that will cause\n implementors to also use a fixed point implementation.\n \n\n", "explain-preemptionPolicy": "KIND: Pod\nVERSION: v1\n\nFIELD: preemptionPolicy \n\nDESCRIPTION:\n PreemptionPolicy is the Policy for preempting pods with lower priority. One\n of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.\n \n Possible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower\n priority.\n \n\n", "explain-priority": "KIND: Pod\nVERSION: v1\n\nFIELD: priority \n\nDESCRIPTION:\n The priority value. Various system components use this field to find the\n priority of the pod. When Priority Admission Controller is enabled, it\n prevents users from setting this field. The admission controller populates\n this field from PriorityClassName. The higher the value, the higher the\n priority.\n \n\n", @@ -29,15 +29,16 @@ "explain-restartPolicy": "KIND: Pod\nVERSION: v1\n\nFIELD: restartPolicy \n\nDESCRIPTION:\n Restart policy for all containers within the pod. One of Always, OnFailure,\n Never. In some contexts, only a subset of those values may be permitted.\n Default to Always. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n \n Possible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`\n \n\n", "explain-runtimeClassName": "KIND: Pod\nVERSION: v1\n\nFIELD: runtimeClassName \n\nDESCRIPTION:\n RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group,\n which should be used to run this pod. If no RuntimeClass resource matches\n the named class, the pod will not be run. If unset or empty, the \"legacy\"\n RuntimeClass will be used, which is an implicit class with an empty\n definition that uses the default runtime handler. More info:\n https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class\n \n\n", "explain-schedulerName": "KIND: Pod\nVERSION: v1\n\nFIELD: schedulerName \n\nDESCRIPTION:\n If specified, the pod will be dispatched by specified scheduler. If not\n specified, the pod will be dispatched by default scheduler.\n \n\n", - "explain-schedulingGates": "KIND: Pod\nVERSION: v1\n\nFIELD: schedulingGates <[]PodSchedulingGate>\n\nDESCRIPTION:\n SchedulingGates is an opaque list of values that if specified will block\n scheduling the pod. If schedulingGates is not empty, the pod will stay in\n the SchedulingGated state and the scheduler will not attempt to schedule the\n pod.\n \n SchedulingGates can only be set at pod creation time, and be removed only\n afterwards.\n PodSchedulingGate is associated to a Pod to guard its scheduling.\n \nFIELDS:\n name\t -required-\n Name of the scheduling gate. Each scheduling gate must have a unique name\n field.\n\n\n", - "explain-securityContext": "KIND: Pod\nVERSION: v1\n\nFIELD: securityContext \n\nDESCRIPTION:\n SecurityContext holds pod-level security attributes and common container\n settings. Optional: Defaults to empty. See type description for default\n values of each field.\n PodSecurityContext holds pod-level security attributes and common container\n settings. Some fields are also present in container.securityContext. Field\n values of container.securityContext take precedence over field values of\n PodSecurityContext.\n \nFIELDS:\n appArmorProfile\t\n appArmorProfile is the AppArmor options to use by the containers in this\n pod. Note that this field cannot be set when spec.os.name is windows.\n\n fsGroup\t\n A special supplemental group that applies to all containers in a pod. Some\n volume types allow the Kubelet to change the ownership of that volume to be\n owned by the pod:\n \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files\n created in the volume will be owned by FSGroup) 3. The permission bits are\n OR'd with rw-rw----\n \n If unset, the Kubelet will not modify the ownership and permissions of any\n volume. Note that this field cannot be set when spec.os.name is windows.\n\n fsGroupChangePolicy\t\n fsGroupChangePolicy defines behavior of changing ownership and permission of\n the volume before being exposed inside Pod. This field will only apply to\n volume types which support fsGroup based ownership(and permissions). It will\n have no effect on ephemeral volume types such as: secret, configmaps and\n emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified,\n \"Always\" is used. Note that this field cannot be set when spec.os.name is\n windows.\n \n Possible enum values:\n - `\"Always\"` indicates that volume's ownership and permissions should\n always be changed whenever volume is mounted inside a Pod. This the default\n behavior.\n - `\"OnRootMismatch\"` indicates that volume's ownership and permissions will\n be changed only when permission and ownership of root directory does not\n match with expected permissions on the volume. This can help shorten the\n time it takes to change ownership and permissions of a volume.\n\n runAsGroup\t\n The GID to run the entrypoint of the container process. Uses runtime default\n if unset. May also be set in SecurityContext. If set in both\n SecurityContext and PodSecurityContext, the value specified in\n SecurityContext takes precedence for that container. Note that this field\n cannot be set when spec.os.name is windows.\n\n runAsNonRoot\t\n Indicates that the container must run as a non-root user. If true, the\n Kubelet will validate the image at runtime to ensure that it does not run as\n UID 0 (root) and fail to start the container if it does. If unset or false,\n no such validation will be performed. May also be set in SecurityContext.\n If set in both SecurityContext and PodSecurityContext, the value specified\n in SecurityContext takes precedence.\n\n runAsUser\t\n The UID to run the entrypoint of the container process. Defaults to user\n specified in image metadata if unspecified. May also be set in\n SecurityContext. If set in both SecurityContext and PodSecurityContext, the\n value specified in SecurityContext takes precedence for that container. Note\n that this field cannot be set when spec.os.name is windows.\n\n seLinuxOptions\t\n The SELinux context to be applied to all containers. If unspecified, the\n container runtime will allocate a random SELinux context for each container.\n May also be set in SecurityContext. If set in both SecurityContext and\n PodSecurityContext, the value specified in SecurityContext takes precedence\n for that container. Note that this field cannot be set when spec.os.name is\n windows.\n\n seccompProfile\t\n The seccomp options to use by the containers in this pod. Note that this\n field cannot be set when spec.os.name is windows.\n\n supplementalGroups\t<[]integer>\n A list of groups applied to the first process run in each container, in\n addition to the container's primary GID, the fsGroup (if specified), and\n group memberships defined in the container image for the uid of the\n container process. If unspecified, no additional groups are added to any\n container. Note that group memberships defined in the container image for\n the uid of the container process are still effective, even if they are not\n included in this list. Note that this field cannot be set when spec.os.name\n is windows.\n\n sysctls\t<[]Sysctl>\n Sysctls hold a list of namespaced sysctls used for the pod. Pods with\n unsupported sysctls (by the container runtime) might fail to launch. Note\n that this field cannot be set when spec.os.name is windows.\n\n windowsOptions\t\n The Windows specific settings applied to all containers. If unspecified, the\n options within a container's SecurityContext will be used. If set in both\n SecurityContext and PodSecurityContext, the value specified in\n SecurityContext takes precedence. Note that this field cannot be set when\n spec.os.name is linux.\n\n\n", - "explain-serviceAccount": "KIND: Pod\nVERSION: v1\n\nFIELD: serviceAccount \n\nDESCRIPTION:\n DeprecatedServiceAccount is a deprecated alias for ServiceAccountName.\n Deprecated: Use serviceAccountName instead.\n \n\n", + "explain-schedulingGates": "KIND: Pod\nVERSION: v1\n\nFIELD: schedulingGates <[]PodSchedulingGate>\n\nDESCRIPTION:\n SchedulingGates is an opaque list of values that if specified will block\n scheduling the pod. If schedulingGates is not empty, the pod will stay in\n the SchedulingGated state and the scheduler will not attempt to schedule the\n pod.\n \n SchedulingGates can only be set at pod creation time, and be removed only\n afterwards.\n \n This is a beta feature enabled by the PodSchedulingReadiness feature gate.\n PodSchedulingGate is associated to a Pod to guard its scheduling.\n \nFIELDS:\n name\t -required-\n Name of the scheduling gate. Each scheduling gate must have a unique name\n field.\n\n\n", + "explain-securityContext": "KIND: Pod\nVERSION: v1\n\nFIELD: securityContext \n\nDESCRIPTION:\n SecurityContext holds pod-level security attributes and common container\n settings. Optional: Defaults to empty. See type description for default\n values of each field.\n PodSecurityContext holds pod-level security attributes and common container\n settings. Some fields are also present in container.securityContext. Field\n values of container.securityContext take precedence over field values of\n PodSecurityContext.\n \nFIELDS:\n fsGroup\t\n A special supplemental group that applies to all containers in a pod. Some\n volume types allow the Kubelet to change the ownership of that volume to be\n owned by the pod:\n \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files\n created in the volume will be owned by FSGroup) 3. The permission bits are\n OR'd with rw-rw----\n \n If unset, the Kubelet will not modify the ownership and permissions of any\n volume. Note that this field cannot be set when spec.os.name is windows.\n\n fsGroupChangePolicy\t\n fsGroupChangePolicy defines behavior of changing ownership and permission of\n the volume before being exposed inside Pod. This field will only apply to\n volume types which support fsGroup based ownership(and permissions). It will\n have no effect on ephemeral volume types such as: secret, configmaps and\n emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified,\n \"Always\" is used. Note that this field cannot be set when spec.os.name is\n windows.\n \n Possible enum values:\n - `\"Always\"` indicates that volume's ownership and permissions should\n always be changed whenever volume is mounted inside a Pod. This the default\n behavior.\n - `\"OnRootMismatch\"` indicates that volume's ownership and permissions will\n be changed only when permission and ownership of root directory does not\n match with expected permissions on the volume. This can help shorten the\n time it takes to change ownership and permissions of a volume.\n\n runAsGroup\t\n The GID to run the entrypoint of the container process. Uses runtime default\n if unset. May also be set in SecurityContext. If set in both\n SecurityContext and PodSecurityContext, the value specified in\n SecurityContext takes precedence for that container. Note that this field\n cannot be set when spec.os.name is windows.\n\n runAsNonRoot\t\n Indicates that the container must run as a non-root user. If true, the\n Kubelet will validate the image at runtime to ensure that it does not run as\n UID 0 (root) and fail to start the container if it does. If unset or false,\n no such validation will be performed. May also be set in SecurityContext.\n If set in both SecurityContext and PodSecurityContext, the value specified\n in SecurityContext takes precedence.\n\n runAsUser\t\n The UID to run the entrypoint of the container process. Defaults to user\n specified in image metadata if unspecified. May also be set in\n SecurityContext. If set in both SecurityContext and PodSecurityContext, the\n value specified in SecurityContext takes precedence for that container. Note\n that this field cannot be set when spec.os.name is windows.\n\n seLinuxOptions\t\n The SELinux context to be applied to all containers. If unspecified, the\n container runtime will allocate a random SELinux context for each container.\n May also be set in SecurityContext. If set in both SecurityContext and\n PodSecurityContext, the value specified in SecurityContext takes precedence\n for that container. Note that this field cannot be set when spec.os.name is\n windows.\n\n seccompProfile\t\n The seccomp options to use by the containers in this pod. Note that this\n field cannot be set when spec.os.name is windows.\n\n supplementalGroups\t<[]integer>\n A list of groups applied to the first process run in each container, in\n addition to the container's primary GID, the fsGroup (if specified), and\n group memberships defined in the container image for the uid of the\n container process. If unspecified, no additional groups are added to any\n container. Note that group memberships defined in the container image for\n the uid of the container process are still effective, even if they are not\n included in this list. Note that this field cannot be set when spec.os.name\n is windows.\n\n sysctls\t<[]Sysctl>\n Sysctls hold a list of namespaced sysctls used for the pod. Pods with\n unsupported sysctls (by the container runtime) might fail to launch. Note\n that this field cannot be set when spec.os.name is windows.\n\n windowsOptions\t\n The Windows specific settings applied to all containers. If unspecified, the\n options within a container's SecurityContext will be used. If set in both\n SecurityContext and PodSecurityContext, the value specified in\n SecurityContext takes precedence. Note that this field cannot be set when\n spec.os.name is linux.\n\n\n", + "explain-serviceAccount": "KIND: Pod\nVERSION: v1\n\nFIELD: serviceAccount \n\nDESCRIPTION:\n DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.\n Deprecated: Use serviceAccountName instead.\n \n\n", "explain-serviceAccountName": "KIND: Pod\nVERSION: v1\n\nFIELD: serviceAccountName \n\nDESCRIPTION:\n ServiceAccountName is the name of the ServiceAccount to use to run this pod.\n More info:\n https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n \n\n", "explain-setHostnameAsFQDN": "KIND: Pod\nVERSION: v1\n\nFIELD: setHostnameAsFQDN \n\nDESCRIPTION:\n If true the pod's hostname will be configured as the pod's FQDN, rather than\n the leaf name (the default). In Linux containers, this means setting the\n FQDN in the hostname field of the kernel (the nodename field of struct\n utsname). In Windows containers, this means setting the registry value of\n hostname for the registry key\n HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to\n FQDN. If a pod does not have FQDN, this has no effect. Default to false.\n \n\n", "explain-shareProcessNamespace": "KIND: Pod\nVERSION: v1\n\nFIELD: shareProcessNamespace \n\nDESCRIPTION:\n Share a single process namespace between all of the containers in a pod.\n When this is set containers will be able to view and signal processes from\n other containers in the same pod, and the first process in each container\n will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be\n set. Optional: Default to false.\n \n\n", "explain-subdomain": "KIND: Pod\nVERSION: v1\n\nFIELD: subdomain \n\nDESCRIPTION:\n If specified, the fully qualified Pod hostname will be\n \"...svc.\". If not\n specified, the pod will not have a domainname at all.\n \n\n", "explain-terminationGracePeriodSeconds": "KIND: Pod\nVERSION: v1\n\nFIELD: terminationGracePeriodSeconds \n\nDESCRIPTION:\n Optional duration in seconds the pod needs to terminate gracefully. May be\n decreased in delete request. Value must be non-negative integer. The value\n zero indicates stop immediately via the kill signal (no opportunity to shut\n down). If this value is nil, the default grace period will be used instead.\n The grace period is the duration in seconds after the processes running in\n the pod are sent a termination signal and the time when the processes are\n forcibly halted with a kill signal. Set this value longer than the expected\n cleanup time for your process. Defaults to 30 seconds.\n \n\n", "explain-tolerations": "KIND: Pod\nVERSION: v1\n\nFIELD: tolerations <[]Toleration>\n\nDESCRIPTION:\n If specified, the pod's tolerations.\n The pod this Toleration is attached to tolerates any taint that matches the\n triple using the matching operator .\n \nFIELDS:\n effect\t\n Effect indicates the taint effect to match. Empty means match all taint\n effects. When specified, allowed values are NoSchedule, PreferNoSchedule and\n NoExecute.\n \n Possible enum values:\n - `\"NoExecute\"` Evict any already-running pods that do not tolerate the\n taint. Currently enforced by NodeController.\n - `\"NoSchedule\"` Do not allow new pods to schedule onto the node unless\n they tolerate the taint, but allow all pods submitted to Kubelet without\n going through the scheduler to start, and allow all already-running pods to\n continue running. Enforced by the scheduler.\n - `\"PreferNoSchedule\"` Like TaintEffectNoSchedule, but the scheduler tries\n not to schedule new pods onto the node, rather than prohibiting new pods\n from scheduling onto the node entirely. Enforced by the scheduler.\n\n key\t\n Key is the taint key that the toleration applies to. Empty means match all\n taint keys. If the key is empty, operator must be Exists; this combination\n means to match all values and all keys.\n\n operator\t\n Operator represents a key's relationship to the value. Valid operators are\n Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for\n value, so that a pod can tolerate all taints of a particular category.\n \n Possible enum values:\n - `\"Equal\"`\n - `\"Exists\"`\n\n tolerationSeconds\t\n TolerationSeconds represents the period of time the toleration (which must\n be of effect NoExecute, otherwise this field is ignored) tolerates the\n taint. By default, it is not set, which means tolerate the taint forever (do\n not evict). Zero and negative values will be treated as 0 (evict\n immediately) by the system.\n\n value\t\n Value is the taint value the toleration matches to. If the operator is\n Exists, the value should be empty, otherwise just a regular string.\n\n\n", - "explain-topologySpreadConstraints": "KIND: Pod\nVERSION: v1\n\nFIELD: topologySpreadConstraints <[]TopologySpreadConstraint>\n\nDESCRIPTION:\n TopologySpreadConstraints describes how a group of pods ought to spread\n across topology domains. Scheduler will schedule pods in a way which abides\n by the constraints. All topologySpreadConstraints are ANDed.\n TopologySpreadConstraint specifies how to spread matching pods among the\n given topology.\n \nFIELDS:\n labelSelector\t\n LabelSelector is used to find matching pods. Pods that match this label\n selector are counted to determine the number of pods in their corresponding\n topology domain.\n\n matchLabelKeys\t<[]string>\n MatchLabelKeys is a set of pod label keys to select the pods over which\n spreading will be calculated. The keys are used to lookup values from the\n incoming pod labels, those key-value labels are ANDed with labelSelector to\n select the group of existing pods over which spreading will be calculated\n for the incoming pod. The same key is forbidden to exist in both\n MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when\n LabelSelector isn't set. Keys that don't exist in the incoming pod labels\n will be ignored. A null or empty list means only match against\n labelSelector.\n \n This is a beta field and requires the MatchLabelKeysInPodTopologySpread\n feature gate to be enabled (enabled by default).\n\n maxSkew\t -required-\n MaxSkew describes the degree to which pods may be unevenly distributed. When\n `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference\n between the number of matching pods in the target topology and the global\n minimum. The global minimum is the minimum number of matching pods in an\n eligible domain or zero if the number of eligible domains is less than\n MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods\n with the same labelSelector spread as 2/2/1: In this case, the global\n minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if\n MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;\n scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on\n zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be\n scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used\n to give higher precedence to topologies that satisfy it. It's a required\n field. Default value is 1 and 0 is not allowed.\n\n minDomains\t\n MinDomains indicates a minimum number of eligible domains. When the number\n of eligible domains with matching topology keys is less than minDomains, Pod\n Topology Spread treats \"global minimum\" as 0, and then the calculation of\n Skew is performed. And when the number of eligible domains with matching\n topology keys equals or greater than minDomains, this value has no effect on\n scheduling. As a result, when the number of eligible domains is less than\n minDomains, scheduler won't schedule more than maxSkew Pods to those\n domains. If value is nil, the constraint behaves as if MinDomains is equal\n to 1. Valid values are integers greater than 0. When value is not nil,\n WhenUnsatisfiable must be DoNotSchedule.\n \n For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to\n 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 |\n zone3 | | P P | P P | P P | The number of domains is less than\n 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new\n pod with the same labelSelector cannot be scheduled, because computed skew\n will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will\n violate MaxSkew.\n\n nodeAffinityPolicy\t\n NodeAffinityPolicy indicates how we will treat Pod's\n nodeAffinity/nodeSelector when calculating pod topology spread skew. Options\n are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in\n the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes\n are included in the calculations.\n \n If this value is nil, the behavior is equivalent to the Honor policy. This\n is a beta-level feature default enabled by the\n NodeInclusionPolicyInPodTopologySpread feature flag.\n \n Possible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod\n topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod\n topology spread skew.\n\n nodeTaintsPolicy\t\n NodeTaintsPolicy indicates how we will treat node taints when calculating\n pod topology spread skew. Options are: - Honor: nodes without taints, along\n with tainted nodes for which the incoming pod has a toleration, are\n included. - Ignore: node taints are ignored. All nodes are included.\n \n If this value is nil, the behavior is equivalent to the Ignore policy. This\n is a beta-level feature default enabled by the\n NodeInclusionPolicyInPodTopologySpread feature flag.\n \n Possible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod\n topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod\n topology spread skew.\n\n topologyKey\t -required-\n TopologyKey is the key of node labels. Nodes that have a label with this key\n and identical values are considered to be in the same topology. We consider\n each as a \"bucket\", and try to put balanced number of pods into\n each bucket. We define a domain as a particular instance of a topology.\n Also, we define an eligible domain as a domain whose nodes meet the\n requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey\n is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if\n TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that\n topology. It's a required field.\n\n whenUnsatisfiable\t -required-\n WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the\n spread constraint. - DoNotSchedule (default) tells the scheduler not to\n schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any\n location,\n but giving higher precedence to topologies that would help reduce the\n skew.\n A constraint is considered \"Unsatisfiable\" for an incoming pod if and only\n if every possible node assignment for that pod would violate \"MaxSkew\" on\n some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and\n pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 |\n | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule,\n incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as\n ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the\n cluster can still be imbalanced, but scheduler won't make it *more*\n imbalanced. It's a required field.\n \n Possible enum values:\n - `\"DoNotSchedule\"` instructs the scheduler not to schedule the pod when\n constraints are not satisfied.\n - `\"ScheduleAnyway\"` instructs the scheduler to schedule the pod even if\n constraints are not satisfied.\n\n\n", - "explain-volumes": "KIND: Pod\nVERSION: v1\n\nFIELD: volumes <[]Volume>\n\nDESCRIPTION:\n List of volumes that can be mounted by containers belonging to the pod. More\n info: https://kubernetes.io/docs/concepts/storage/volumes\n Volume represents a named volume in a pod that may be accessed by any\n container in the pod.\n \nFIELDS:\n awsElasticBlockStore\t\n awsElasticBlockStore represents an AWS Disk resource that is attached to a\n kubelet's host machine and then exposed to the pod. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore\n\n azureDisk\t\n azureDisk represents an Azure Data Disk mount on the host and bind mount to\n the pod.\n\n azureFile\t\n azureFile represents an Azure File Service mount on the host and bind mount\n to the pod.\n\n cephfs\t\n cephFS represents a Ceph FS mount on the host that shares a pod's lifetime\n\n cinder\t\n cinder represents a cinder volume attached and mounted on kubelets host\n machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md\n\n configMap\t\n configMap represents a configMap that should populate this volume\n\n csi\t\n csi (Container Storage Interface) represents ephemeral storage that is\n handled by certain external CSI drivers (Beta feature).\n\n downwardAPI\t\n downwardAPI represents downward API about the pod that should populate this\n volume\n\n emptyDir\t\n emptyDir represents a temporary directory that shares a pod's lifetime. More\n info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir\n\n ephemeral\t\n ephemeral represents a volume that is handled by a cluster storage driver.\n The volume's lifecycle is tied to the pod that defines it - it will be\n created before the pod starts, and deleted when the pod is removed.\n \n Use this if: a) the volume is only needed while the pod runs, b) features of\n normal volumes like restoring from snapshot or capacity\n tracking are needed,\n c) the storage driver is specified through a storage class, and d) the\n storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes\n that persist for longer than the lifecycle of an individual pod.\n \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant\n to be used that way - see the documentation of the driver for more\n information.\n \n A pod can use both types of ephemeral volumes and persistent volumes at the\n same time.\n\n fc\t\n fc represents a Fibre Channel resource that is attached to a kubelet's host\n machine and then exposed to the pod.\n\n flexVolume\t\n flexVolume represents a generic volume resource that is provisioned/attached\n using an exec based plugin.\n\n flocker\t\n flocker represents a Flocker volume attached to a kubelet's host machine.\n This depends on the Flocker control service being running\n\n gcePersistentDisk\t\n gcePersistentDisk represents a GCE Disk resource that is attached to a\n kubelet's host machine and then exposed to the pod. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\n\n gitRepo\t\n gitRepo represents a git repository at a particular revision. DEPRECATED:\n GitRepo is deprecated. To provision a container with a git repo, mount an\n EmptyDir into an InitContainer that clones the repo using git, then mount\n the EmptyDir into the Pod's container.\n\n glusterfs\t\n glusterfs represents a Glusterfs mount on the host that shares a pod's\n lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md\n\n hostPath\t\n hostPath represents a pre-existing file or directory on the host machine\n that is directly exposed to the container. This is generally used for system\n agents or other privileged things that are allowed to see the host machine.\n Most containers will NOT need this. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#hostpath\n\n iscsi\t\n iscsi represents an ISCSI Disk resource that is attached to a kubelet's host\n machine and then exposed to the pod. More info:\n https://examples.k8s.io/volumes/iscsi/README.md\n\n name\t -required-\n name of the volume. Must be a DNS_LABEL and unique within the pod. More\n info:\n https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n\n nfs\t\n nfs represents an NFS mount on the host that shares a pod's lifetime More\n info: https://kubernetes.io/docs/concepts/storage/volumes#nfs\n\n persistentVolumeClaim\t\n persistentVolumeClaimVolumeSource represents a reference to a\n PersistentVolumeClaim in the same namespace. More info:\n https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims\n\n photonPersistentDisk\t\n photonPersistentDisk represents a PhotonController persistent disk attached\n and mounted on kubelets host machine\n\n portworxVolume\t\n portworxVolume represents a portworx volume attached and mounted on kubelets\n host machine\n\n projected\t\n projected items for all in one resources secrets, configmaps, and downward\n API\n\n quobyte\t\n quobyte represents a Quobyte mount on the host that shares a pod's lifetime\n\n rbd\t\n rbd represents a Rados Block Device mount on the host that shares a pod's\n lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md\n\n scaleIO\t\n scaleIO represents a ScaleIO persistent volume attached and mounted on\n Kubernetes nodes.\n\n secret\t\n secret represents a secret that should populate this volume. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#secret\n\n storageos\t\n storageOS represents a StorageOS volume attached and mounted on Kubernetes\n nodes.\n\n vsphereVolume\t\n vsphereVolume represents a vSphere volume attached and mounted on kubelets\n host machine\n\n\n" + "explain-topologySpreadConstraints": "KIND: Pod\nVERSION: v1\n\nFIELD: topologySpreadConstraints <[]TopologySpreadConstraint>\n\nDESCRIPTION:\n TopologySpreadConstraints describes how a group of pods ought to spread\n across topology domains. Scheduler will schedule pods in a way which abides\n by the constraints. All topologySpreadConstraints are ANDed.\n TopologySpreadConstraint specifies how to spread matching pods among the\n given topology.\n \nFIELDS:\n labelSelector\t\n LabelSelector is used to find matching pods. Pods that match this label\n selector are counted to determine the number of pods in their corresponding\n topology domain.\n\n matchLabelKeys\t<[]string>\n MatchLabelKeys is a set of pod label keys to select the pods over which\n spreading will be calculated. The keys are used to lookup values from the\n incoming pod labels, those key-value labels are ANDed with labelSelector to\n select the group of existing pods over which spreading will be calculated\n for the incoming pod. The same key is forbidden to exist in both\n MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when\n LabelSelector isn't set. Keys that don't exist in the incoming pod labels\n will be ignored. A null or empty list means only match against\n labelSelector.\n \n This is a beta field and requires the MatchLabelKeysInPodTopologySpread\n feature gate to be enabled (enabled by default).\n\n maxSkew\t -required-\n MaxSkew describes the degree to which pods may be unevenly distributed. When\n `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference\n between the number of matching pods in the target topology and the global\n minimum. The global minimum is the minimum number of matching pods in an\n eligible domain or zero if the number of eligible domains is less than\n MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods\n with the same labelSelector spread as 2/2/1: In this case, the global\n minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if\n MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;\n scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on\n zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be\n scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used\n to give higher precedence to topologies that satisfy it. It's a required\n field. Default value is 1 and 0 is not allowed.\n\n minDomains\t\n MinDomains indicates a minimum number of eligible domains. When the number\n of eligible domains with matching topology keys is less than minDomains, Pod\n Topology Spread treats \"global minimum\" as 0, and then the calculation of\n Skew is performed. And when the number of eligible domains with matching\n topology keys equals or greater than minDomains, this value has no effect on\n scheduling. As a result, when the number of eligible domains is less than\n minDomains, scheduler won't schedule more than maxSkew Pods to those\n domains. If value is nil, the constraint behaves as if MinDomains is equal\n to 1. Valid values are integers greater than 0. When value is not nil,\n WhenUnsatisfiable must be DoNotSchedule.\n \n For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to\n 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 |\n zone3 | | P P | P P | P P | The number of domains is less than\n 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new\n pod with the same labelSelector cannot be scheduled, because computed skew\n will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will\n violate MaxSkew.\n \n This is a beta field and requires the MinDomainsInPodTopologySpread feature\n gate to be enabled (enabled by default).\n\n nodeAffinityPolicy\t\n NodeAffinityPolicy indicates how we will treat Pod's\n nodeAffinity/nodeSelector when calculating pod topology spread skew. Options\n are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in\n the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes\n are included in the calculations.\n \n If this value is nil, the behavior is equivalent to the Honor policy. This\n is a beta-level feature default enabled by the\n NodeInclusionPolicyInPodTopologySpread feature flag.\n \n Possible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod\n topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod\n topology spread skew.\n\n nodeTaintsPolicy\t\n NodeTaintsPolicy indicates how we will treat node taints when calculating\n pod topology spread skew. Options are: - Honor: nodes without taints, along\n with tainted nodes for which the incoming pod has a toleration, are\n included. - Ignore: node taints are ignored. All nodes are included.\n \n If this value is nil, the behavior is equivalent to the Ignore policy. This\n is a beta-level feature default enabled by the\n NodeInclusionPolicyInPodTopologySpread feature flag.\n \n Possible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod\n topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod\n topology spread skew.\n\n topologyKey\t -required-\n TopologyKey is the key of node labels. Nodes that have a label with this key\n and identical values are considered to be in the same topology. We consider\n each as a \"bucket\", and try to put balanced number of pods into\n each bucket. We define a domain as a particular instance of a topology.\n Also, we define an eligible domain as a domain whose nodes meet the\n requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey\n is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if\n TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that\n topology. It's a required field.\n\n whenUnsatisfiable\t -required-\n WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the\n spread constraint. - DoNotSchedule (default) tells the scheduler not to\n schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any\n location,\n but giving higher precedence to topologies that would help reduce the\n skew.\n A constraint is considered \"Unsatisfiable\" for an incoming pod if and only\n if every possible node assignment for that pod would violate \"MaxSkew\" on\n some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and\n pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 |\n | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule,\n incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as\n ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the\n cluster can still be imbalanced, but scheduler won't make it *more*\n imbalanced. It's a required field.\n \n Possible enum values:\n - `\"DoNotSchedule\"` instructs the scheduler not to schedule the pod when\n constraints are not satisfied.\n - `\"ScheduleAnyway\"` instructs the scheduler to schedule the pod even if\n constraints are not satisfied.\n\n\n", + "explain-volumes": "KIND: Pod\nVERSION: v1\n\nFIELD: volumes <[]Volume>\n\nDESCRIPTION:\n List of volumes that can be mounted by containers belonging to the pod. More\n info: https://kubernetes.io/docs/concepts/storage/volumes\n Volume represents a named volume in a pod that may be accessed by any\n container in the pod.\n \nFIELDS:\n awsElasticBlockStore\t\n awsElasticBlockStore represents an AWS Disk resource that is attached to a\n kubelet's host machine and then exposed to the pod. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore\n\n azureDisk\t\n azureDisk represents an Azure Data Disk mount on the host and bind mount to\n the pod.\n\n azureFile\t\n azureFile represents an Azure File Service mount on the host and bind mount\n to the pod.\n\n cephfs\t\n cephFS represents a Ceph FS mount on the host that shares a pod's lifetime\n\n cinder\t\n cinder represents a cinder volume attached and mounted on kubelets host\n machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md\n\n configMap\t\n configMap represents a configMap that should populate this volume\n\n csi\t\n csi (Container Storage Interface) represents ephemeral storage that is\n handled by certain external CSI drivers (Beta feature).\n\n downwardAPI\t\n downwardAPI represents downward API about the pod that should populate this\n volume\n\n emptyDir\t\n emptyDir represents a temporary directory that shares a pod's lifetime. More\n info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir\n\n ephemeral\t\n ephemeral represents a volume that is handled by a cluster storage driver.\n The volume's lifecycle is tied to the pod that defines it - it will be\n created before the pod starts, and deleted when the pod is removed.\n \n Use this if: a) the volume is only needed while the pod runs, b) features of\n normal volumes like restoring from snapshot or capacity\n tracking are needed,\n c) the storage driver is specified through a storage class, and d) the\n storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes\n that persist for longer than the lifecycle of an individual pod.\n \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant\n to be used that way - see the documentation of the driver for more\n information.\n \n A pod can use both types of ephemeral volumes and persistent volumes at the\n same time.\n\n fc\t\n fc represents a Fibre Channel resource that is attached to a kubelet's host\n machine and then exposed to the pod.\n\n flexVolume\t\n flexVolume represents a generic volume resource that is provisioned/attached\n using an exec based plugin.\n\n flocker\t\n flocker represents a Flocker volume attached to a kubelet's host machine.\n This depends on the Flocker control service being running\n\n gcePersistentDisk\t\n gcePersistentDisk represents a GCE Disk resource that is attached to a\n kubelet's host machine and then exposed to the pod. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\n\n gitRepo\t\n gitRepo represents a git repository at a particular revision. DEPRECATED:\n GitRepo is deprecated. To provision a container with a git repo, mount an\n EmptyDir into an InitContainer that clones the repo using git, then mount\n the EmptyDir into the Pod's container.\n\n glusterfs\t\n glusterfs represents a Glusterfs mount on the host that shares a pod's\n lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md\n\n hostPath\t\n hostPath represents a pre-existing file or directory on the host machine\n that is directly exposed to the container. This is generally used for system\n agents or other privileged things that are allowed to see the host machine.\n Most containers will NOT need this. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#hostpath\n\n iscsi\t\n iscsi represents an ISCSI Disk resource that is attached to a kubelet's host\n machine and then exposed to the pod. More info:\n https://examples.k8s.io/volumes/iscsi/README.md\n\n name\t -required-\n name of the volume. Must be a DNS_LABEL and unique within the pod. More\n info:\n https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n\n nfs\t\n nfs represents an NFS mount on the host that shares a pod's lifetime More\n info: https://kubernetes.io/docs/concepts/storage/volumes#nfs\n\n persistentVolumeClaim\t\n persistentVolumeClaimVolumeSource represents a reference to a\n PersistentVolumeClaim in the same namespace. More info:\n https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims\n\n photonPersistentDisk\t\n photonPersistentDisk represents a PhotonController persistent disk attached\n and mounted on kubelets host machine\n\n portworxVolume\t\n portworxVolume represents a portworx volume attached and mounted on kubelets\n host machine\n\n projected\t\n projected items for all in one resources secrets, configmaps, and downward\n API\n\n quobyte\t\n quobyte represents a Quobyte mount on the host that shares a pod's lifetime\n\n rbd\t\n rbd represents a Rados Block Device mount on the host that shares a pod's\n lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md\n\n scaleIO\t\n scaleIO represents a ScaleIO persistent volume attached and mounted on\n Kubernetes nodes.\n\n secret\t\n secret represents a secret that should populate this volume. More info:\n https://kubernetes.io/docs/concepts/storage/volumes#secret\n\n storageos\t\n storageOS represents a StorageOS volume attached and mounted on Kubernetes\n nodes.\n\n vsphereVolume\t\n vsphereVolume represents a vSphere volume attached and mounted on kubelets\n host machine\n\n\n", + "explain-spec": "KIND: Pod\nVERSION: v1\n\nFIELD: spec \n\nDESCRIPTION:\n Specification of the desired behavior of the pod. More info:\n https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n PodSpec is a description of a pod.\n \nFIELDS:\n activeDeadlineSeconds\t\n Optional duration in seconds the pod may be active on the node relative to\n StartTime before the system will actively try to mark it failed and kill\n associated containers. Value must be a positive integer.\n\n affinity\t\n If specified, the pod's scheduling constraints\n\n automountServiceAccountToken\t\n AutomountServiceAccountToken indicates whether a service account token\n should be automatically mounted.\n\n containers\t<[]Container> -required-\n List of containers belonging to the pod. Containers cannot currently be\n added or removed. There must be at least one container in a Pod. Cannot be\n updated.\n\n dnsConfig\t\n Specifies the DNS parameters of a pod. Parameters specified here will be\n merged to the generated DNS configuration based on DNSPolicy.\n\n dnsPolicy\t\n Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are\n 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS\n parameters given in DNSConfig will be merged with the policy selected with\n DNSPolicy. To have DNS options set along with hostNetwork, you have to\n specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n \n Possible enum values:\n - `\"ClusterFirst\"` indicates that the pod should use cluster DNS first\n unless hostNetwork is true, if it is available, then fall back on the\n default (as determined by kubelet) DNS settings.\n - `\"ClusterFirstWithHostNet\"` indicates that the pod should use cluster DNS\n first, if it is available, then fall back on the default (as determined by\n kubelet) DNS settings.\n - `\"Default\"` indicates that the pod should use the default (as determined\n by kubelet) DNS settings.\n - `\"None\"` indicates that the pod should use empty DNS settings. DNS\n parameters such as nameservers and search paths should be defined via\n DNSConfig.\n\n enableServiceLinks\t\n EnableServiceLinks indicates whether information about services should be\n injected into pod's environment variables, matching the syntax of Docker\n links. Optional: Defaults to true.\n\n ephemeralContainers\t<[]EphemeralContainer>\n List of ephemeral containers run in this pod. Ephemeral containers may be\n run in an existing pod to perform user-initiated actions such as debugging.\n This list cannot be specified when creating a pod, and it cannot be modified\n by updating the pod spec. In order to add an ephemeral container to an\n existing pod, use the pod's ephemeralcontainers subresource.\n\n hostAliases\t<[]HostAlias>\n HostAliases is an optional list of hosts and IPs that will be injected into\n the pod's hosts file if specified. This is only valid for non-hostNetwork\n pods.\n\n hostIPC\t\n Use the host's ipc namespace. Optional: Default to false.\n\n hostNetwork\t\n Host networking requested for this pod. Use the host's network namespace. If\n this option is set, the ports that will be used must be specified. Default\n to false.\n\n hostPID\t\n Use the host's pid namespace. Optional: Default to false.\n\n hostUsers\t\n Use the host's user namespace. Optional: Default to true. If set to true or\n not present, the pod will be run in the host user namespace, useful for when\n the pod needs a feature only available to the host user namespace, such as\n loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns\n is created for the pod. Setting false is useful for mitigating container\n breakout vulnerabilities even allowing users to run their containers as root\n without actually having root privileges on the host. This field is\n alpha-level and is only honored by servers that enable the\n UserNamespacesSupport feature.\n\n hostname\t\n Specifies the hostname of the Pod If not specified, the pod's hostname will\n be set to a system-defined value.\n\n imagePullSecrets\t<[]LocalObjectReference>\n ImagePullSecrets is an optional list of references to secrets in the same\n namespace to use for pulling any of the images used by this PodSpec. If\n specified, these secrets will be passed to individual puller implementations\n for them to use. More info:\n https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n\n initContainers\t<[]Container>\n List of initialization containers belonging to the pod. Init containers are\n executed in order prior to containers being started. If any init container\n fails, the pod is considered to have failed and is handled according to its\n restartPolicy. The name for an init container or normal container must be\n unique among all containers. Init containers may not have Lifecycle actions,\n Readiness probes, Liveness probes, or Startup probes. The\n resourceRequirements of an init container are taken into account during\n scheduling by finding the highest request/limit for each resource type, and\n then using the max of of that value or the sum of the normal containers.\n Limits are applied to init containers in a similar fashion. Init containers\n cannot currently be added or removed. Cannot be updated. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/init-containers/\n\n nodeName\t\n NodeName is a request to schedule this pod onto a specific node. If it is\n non-empty, the scheduler simply schedules this pod onto that node, assuming\n that it fits resource requirements.\n\n nodeSelector\t\n NodeSelector is a selector which must be true for the pod to fit on a node.\n Selector which must match a node's labels for the pod to be scheduled on\n that node. More info:\n https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n\n os\t\n Specifies the OS of the containers in the pod. Some pod and container fields\n are restricted if this is set.\n \n If the OS field is set to linux, the following fields must be unset:\n -securityContext.windowsOptions\n \n If the OS field is set to windows, following fields must be unset: -\n spec.hostPID - spec.hostIPC - spec.hostUsers -\n spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile -\n spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy -\n spec.securityContext.sysctls - spec.shareProcessNamespace -\n spec.securityContext.runAsUser - spec.securityContext.runAsGroup -\n spec.securityContext.supplementalGroups -\n spec.containers[*].securityContext.seLinuxOptions -\n spec.containers[*].securityContext.seccompProfile -\n spec.containers[*].securityContext.capabilities -\n spec.containers[*].securityContext.readOnlyRootFilesystem -\n spec.containers[*].securityContext.privileged -\n spec.containers[*].securityContext.allowPrivilegeEscalation -\n spec.containers[*].securityContext.procMount -\n spec.containers[*].securityContext.runAsUser -\n spec.containers[*].securityContext.runAsGroup\n\n overhead\t\n Overhead represents the resource overhead associated with running a pod for\n a given RuntimeClass. This field will be autopopulated at admission time by\n the RuntimeClass admission controller. If the RuntimeClass admission\n controller is enabled, overhead must not be set in Pod create requests. The\n RuntimeClass admission controller will reject Pod create requests which have\n the overhead already set. If RuntimeClass is configured and selected in the\n PodSpec, Overhead will be set to the value defined in the corresponding\n RuntimeClass, otherwise it will remain unset and treated as zero. More info:\n https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md\n\n preemptionPolicy\t\n PreemptionPolicy is the Policy for preempting pods with lower priority. One\n of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.\n \n Possible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower\n priority.\n\n priority\t\n The priority value. Various system components use this field to find the\n priority of the pod. When Priority Admission Controller is enabled, it\n prevents users from setting this field. The admission controller populates\n this field from PriorityClassName. The higher the value, the higher the\n priority.\n\n priorityClassName\t\n If specified, indicates the pod's priority. \"system-node-critical\" and\n \"system-cluster-critical\" are two special keywords which indicate the\n highest priorities with the former being the highest priority. Any other\n name must be defined by creating a PriorityClass object with that name. If\n not specified, the pod priority will be default or zero if there is no\n default.\n\n readinessGates\t<[]PodReadinessGate>\n If specified, all readiness gates will be evaluated for pod readiness. A pod\n is ready when all its containers are ready AND all conditions specified in\n the readiness gates have status equal to \"True\" More info:\n https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates\n\n resourceClaims\t<[]PodResourceClaim>\n ResourceClaims defines which ResourceClaims must be allocated and reserved\n before the Pod is allowed to start. The resources will be made available to\n those containers which consume them by name.\n \n This is an alpha field and requires enabling the DynamicResourceAllocation\n feature gate.\n \n This field is immutable.\n\n restartPolicy\t\n Restart policy for all containers within the pod. One of Always, OnFailure,\n Never. In some contexts, only a subset of those values may be permitted.\n Default to Always. More info:\n https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n \n Possible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`\n\n runtimeClassName\t\n RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group,\n which should be used to run this pod. If no RuntimeClass resource matches\n the named class, the pod will not be run. If unset or empty, the \"legacy\"\n RuntimeClass will be used, which is an implicit class with an empty\n definition that uses the default runtime handler. More info:\n https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class\n\n schedulerName\t\n If specified, the pod will be dispatched by specified scheduler. If not\n specified, the pod will be dispatched by default scheduler.\n\n schedulingGates\t<[]PodSchedulingGate>\n SchedulingGates is an opaque list of values that if specified will block\n scheduling the pod. If schedulingGates is not empty, the pod will stay in\n the SchedulingGated state and the scheduler will not attempt to schedule the\n pod.\n \n SchedulingGates can only be set at pod creation time, and be removed only\n afterwards.\n \n This is a beta feature enabled by the PodSchedulingReadiness feature gate.\n\n securityContext\t\n SecurityContext holds pod-level security attributes and common container\n settings. Optional: Defaults to empty. See type description for default\n values of each field.\n\n serviceAccount\t\n DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.\n Deprecated: Use serviceAccountName instead.\n\n serviceAccountName\t\n ServiceAccountName is the name of the ServiceAccount to use to run this pod.\n More info:\n https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n\n setHostnameAsFQDN\t\n If true the pod's hostname will be configured as the pod's FQDN, rather than\n the leaf name (the default). In Linux containers, this means setting the\n FQDN in the hostname field of the kernel (the nodename field of struct\n utsname). In Windows containers, this means setting the registry value of\n hostname for the registry key\n HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to\n FQDN. If a pod does not have FQDN, this has no effect. Default to false.\n\n shareProcessNamespace\t\n Share a single process namespace between all of the containers in a pod.\n When this is set containers will be able to view and signal processes from\n other containers in the same pod, and the first process in each container\n will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be\n set. Optional: Default to false.\n\n subdomain\t\n If specified, the fully qualified Pod hostname will be\n \"...svc.\". If not\n specified, the pod will not have a domainname at all.\n\n terminationGracePeriodSeconds\t\n Optional duration in seconds the pod needs to terminate gracefully. May be\n decreased in delete request. Value must be non-negative integer. The value\n zero indicates stop immediately via the kill signal (no opportunity to shut\n down). If this value is nil, the default grace period will be used instead.\n The grace period is the duration in seconds after the processes running in\n the pod are sent a termination signal and the time when the processes are\n forcibly halted with a kill signal. Set this value longer than the expected\n cleanup time for your process. Defaults to 30 seconds.\n\n tolerations\t<[]Toleration>\n If specified, the pod's tolerations.\n\n topologySpreadConstraints\t<[]TopologySpreadConstraint>\n TopologySpreadConstraints describes how a group of pods ought to spread\n across topology domains. Scheduler will schedule pods in a way which abides\n by the constraints. All topologySpreadConstraints are ANDed.\n\n volumes\t<[]Volume>\n List of volumes that can be mounted by containers belonging to the pod. More\n info: https://kubernetes.io/docs/concepts/storage/volumes\n\n\n" } diff --git a/class_generator/tests/manifests/pod/pod_res.py b/class_generator/tests/manifests/pod/pod_res.py index 1a56c6bf68..bcec363293 100644 --- a/class_generator/tests/manifests/pod/pod_res.py +++ b/class_generator/tests/manifests/pod/pod_res.py @@ -470,7 +470,8 @@ def __init__( Cannot be updated. host_aliases(Dict[Any, Any]): HostAliases is an optional list of hosts and IPs that will be injected into - the pod's hosts file if specified. + the pod's hosts file if specified. This is only valid for non-hostNetwork + pods. HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. @@ -478,7 +479,7 @@ def __init__( hostnames <[]string> Hostnames for the above IP address. - ip -required- + ip IP address of the host file entry. host_ipc(bool): Use the host's ipc namespace. Optional: Default to false. @@ -512,9 +513,7 @@ def __init__( FIELDS: name - Name of the referent. This field is effectively required, but due to - backwards compatibility is allowed to be empty. Instances of this type with - an empty value here are almost certainly wrong. More info: + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names init_containers(Dict[Any, Any]): List of initialization containers belonging to the pod. Init containers are @@ -721,12 +720,11 @@ def __init__( If the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - - spec.shareProcessNamespace - spec.securityContext.runAsUser - - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - - spec.containers[*].securityContext.appArmorProfile - + spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - + spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - + spec.securityContext.sysctls - spec.shareProcessNamespace - + spec.securityContext.runAsUser - spec.securityContext.runAsGroup - + spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - @@ -895,6 +893,8 @@ def __init__( SchedulingGates can only be set at pod creation time, and be removed only afterwards. + + This is a beta feature enabled by the PodSchedulingReadiness feature gate. PodSchedulingGate is associated to a Pod to guard its scheduling. FIELDS: @@ -911,10 +911,6 @@ def __init__( PodSecurityContext. FIELDS: - appArmorProfile - appArmorProfile is the AppArmor options to use by the containers in this - pod. Note that this field cannot be set when spec.os.name is windows. - fsGroup A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be @@ -1001,7 +997,7 @@ def __init__( SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - service_account(str): DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. + service_account(str): DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead. service_account_name(str): ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -1143,6 +1139,9 @@ def __init__( will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew. + This is a beta field and requires the MinDomainsInPodTopologySpread feature + gate to be enabled (enabled by default). + nodeAffinityPolicy NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options diff --git a/class_generator/tests/test_class_generator.py b/class_generator/tests/test_class_generator.py index 2662e0e995..32f72797e8 100644 --- a/class_generator/tests/test_class_generator.py +++ b/class_generator/tests/test_class_generator.py @@ -16,6 +16,11 @@ os.path.join(TESTS_MANIFESTS_DIR, "api_server", "api_server_debug.json"), os.path.join(TESTS_MANIFESTS_DIR, "api_server", "api_server_res.py"), ), + ( + "cluster_operator", + os.path.join(TESTS_MANIFESTS_DIR, "cluster_operator", "cluster_operator_debug.json"), + os.path.join(TESTS_MANIFESTS_DIR, "cluster_operator", "cluster_operator_res.py"), + ), ( "config_map", os.path.join(TESTS_MANIFESTS_DIR, "config_map", "config_map_debug.json"), @@ -37,9 +42,9 @@ os.path.join(TESTS_MANIFESTS_DIR, "secret", "secret_res.py"), ), ( - "cluster_operator", - os.path.join(TESTS_MANIFESTS_DIR, "cluster_operator", "cluster_operator_debug.json"), - os.path.join(TESTS_MANIFESTS_DIR, "cluster_operator", "cluster_operator_res.py"), + "image_content_source_policy", + os.path.join(TESTS_MANIFESTS_DIR, "image_content_source_policy", "image_content_source_policy_debug.json"), + os.path.join(TESTS_MANIFESTS_DIR, "image_content_source_policy", "image_content_source_policy_res.py"), ), ), ) diff --git a/ocp_resources/image_content_source_policy.py b/ocp_resources/image_content_source_policy.py index 2a1e3b3ead..90af115aad 100644 --- a/ocp_resources/image_content_source_policy.py +++ b/ocp_resources/image_content_source_policy.py @@ -1,31 +1,75 @@ -from ocp_resources.resource import MissingRequiredArgumentError, Resource +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, List, Optional +from ocp_resources.resource import Resource class ImageContentSourcePolicy(Resource): """ - ICSP object, inherited from Resource. + ImageContentSourcePolicy holds cluster-wide information about how to handle + registry mirror rules. When multiple policies are defined, the outcome of + the behavior is defined on each field. + Compatibility level 4: No compatibility is provided, the API can change at + any point for any reason. These capabilities should not be used by + applications needing long term support. """ - api_group = Resource.ApiGroup.OPERATOR_OPENSHIFT_IO + api_group: str = Resource.ApiGroup.OPERATOR_OPENSHIFT_IO - def __init__(self, repository_digest_mirrors=None, **kwargs): + def __init__( + self, + repository_digest_mirrors: Optional[List[Any]] = None, + **kwargs: Any, + ) -> None: """ - Create/Manage ICSP configuration object. API reference: - https://docs.openshift.com/container-platform/4.12/rest_api/operator_apis/imagecontentsourcepolicy-operator-openshift-io-v1alpha1.html - Args: - repository_digest_mirrors (list of dict): - e.g. [{source: , mirrors: }, ..., {source: , mirrors: }] - - source - the repository that users refer to, e.g. in image pull specifications - - mirrors - one or more repositories (str) that may also contain the same images. The order - of mirrors in this list is treated as the user’s desired priority + repository_digest_mirrors(List[Any]): repositoryDigestMirrors allows images referenced by image digests in pods to + be pulled from alternative mirrored repository locations. The image pull + specification provided to the pod will be compared to the source locations + described in RepositoryDigestMirrors and the image may be pulled down from + any of the mirrors in the list instead of the specified repository allowing + administrators to choose a potentially faster mirror. Only image pull + specifications that have an image digest will have this behavior applied to + them - tags will continue to be pulled from the specified repository in the + pull spec. + Each “source” repository is treated independently; configurations for + different “source” repositories don’t interact. + When multiple policies are defined for the same “source” repository, the + sets of defined mirrors will be merged together, preserving the relative + order of the mirrors, if possible. For example, if policy A has mirrors `a, + b, c` and policy B has mirrors `c, d, e`, the mirrors will be used in the + order `a, b, c, d, e`. If the orders of mirror entries conflict (e.g. `a, + b` vs. `b, a`) the configuration is not rejected but the resulting order is + unspecified. + RepositoryDigestMirrors holds cluster-wide information about how to handle + mirros in the registries config. Note: the mirrors only work when pulling + the images that are referenced by their digests. + + FIELDS: + mirrors <[]string> + mirrors is one or more repositories that may also contain the same images. + The order of mirrors in this list is treated as the user's desired priority, + while source is by default considered lower priority than all mirrors. Other + cluster configuration, including (but not limited to) other + repositoryDigestMirrors objects, may impact the exact order mirrors are + contacted in, or some mirrors may be contacted in parallel, so this should + be considered a preference rather than a guarantee of ordering. + + source -required- + source is the repository that users refer to, e.g. in image pull + specifications. + """ - self.repository_digest_mirrors = repository_digest_mirrors super().__init__(**kwargs) + self.repository_digest_mirrors = repository_digest_mirrors + def to_dict(self) -> None: super().to_dict() + if not self.yaml_file: - if not self.repository_digest_mirrors: - raise MissingRequiredArgumentError(argument="repository_digest_mirrors") - self.res["spec"] = {"repositoryDigestMirrors": self.repository_digest_mirrors} + self.res["spec"] = {} + _spec = self.res["spec"] + + if self.repository_digest_mirrors: + _spec["repositoryDigestMirrors"] = self.repository_digest_mirrors diff --git a/ocp_resources/kubevirt_common_templates_bundle.py b/ocp_resources/kubevirt_common_templates_bundle.py deleted file mode 100644 index 191af1cdd6..0000000000 --- a/ocp_resources/kubevirt_common_templates_bundle.py +++ /dev/null @@ -1,5 +0,0 @@ -from ocp_resources.resource import NamespacedResource - - -class KubevirtCommonTemplatesBundle(NamespacedResource): - api_group = NamespacedResource.ApiGroup.SSP_KUBEVIRT_IO diff --git a/ocp_resources/kubevirt_metrics_aggregation.py b/ocp_resources/kubevirt_metrics_aggregation.py deleted file mode 100644 index 7b661c16cd..0000000000 --- a/ocp_resources/kubevirt_metrics_aggregation.py +++ /dev/null @@ -1,5 +0,0 @@ -from ocp_resources.resource import NamespacedResource - - -class KubevirtMetricsAggregation(NamespacedResource): - api_group = NamespacedResource.ApiGroup.SSP_KUBEVIRT_IO diff --git a/ocp_resources/kubevirt_node_labeller_bundle.py b/ocp_resources/kubevirt_node_labeller_bundle.py deleted file mode 100644 index fa4a5a7be4..0000000000 --- a/ocp_resources/kubevirt_node_labeller_bundle.py +++ /dev/null @@ -1,5 +0,0 @@ -from ocp_resources.resource import NamespacedResource - - -class KubevirtNodeLabellerBundle(NamespacedResource): - api_group = NamespacedResource.ApiGroup.SSP_KUBEVIRT_IO diff --git a/ocp_resources/kubevirt_template_validaotr.py b/ocp_resources/kubevirt_template_validaotr.py deleted file mode 100644 index cca51e9a14..0000000000 --- a/ocp_resources/kubevirt_template_validaotr.py +++ /dev/null @@ -1,5 +0,0 @@ -from ocp_resources.resource import NamespacedResource - - -class KubevirtTemplateValidator(NamespacedResource): - api_group = NamespacedResource.ApiGroup.SSP_KUBEVIRT_IO diff --git a/ocp_resources/virtual_machine_cluster_instancetype.py b/ocp_resources/virtual_machine_cluster_instancetype.py index 1d1ddae9d7..4d11cb6f11 100644 --- a/ocp_resources/virtual_machine_cluster_instancetype.py +++ b/ocp_resources/virtual_machine_cluster_instancetype.py @@ -1,7 +1,7 @@ # Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md -from typing import Any -from ocp_resources.resource import Resource +from typing import Any, Dict, List, Optional +from ocp_resources.resource import Resource, MissingRequiredArgumentError class VirtualMachineClusterInstancetype(Resource): @@ -14,6 +14,165 @@ class VirtualMachineClusterInstancetype(Resource): def __init__( self, + annotations: Optional[Dict[str, Any]] = None, + cpu: Optional[Dict[str, Any]] = None, + gpus: Optional[List[Any]] = None, + host_devices: Optional[List[Any]] = None, + io_threads_policy: Optional[str] = "", + launch_security: Optional[Dict[str, Any]] = None, + memory: Optional[Dict[str, Any]] = None, + node_selector: Optional[Dict[str, Any]] = None, + scheduler_name: Optional[str] = "", **kwargs: Any, ) -> None: + """ + Args: + annotations(Dict[Any, Any]): Optionally defines the required Annotations to be used by the instance type + and applied to the VirtualMachineInstance + + cpu(Dict[Any, Any]): Required CPU related attributes of the instancetype. + + FIELDS: + dedicatedCPUPlacement + DedicatedCPUPlacement requests the scheduler to place the + VirtualMachineInstance on a node with enough dedicated pCPUs and pin the + vCPUs to it. + + guest -required- + Required number of vCPUs to expose to the guest. + The resulting CPU topology being derived from the optional + PreferredCPUTopology attribute of CPUPreferences that itself defaults to + PreferSockets. + + isolateEmulatorThread + IsolateEmulatorThread requests one more dedicated pCPU to be allocated for + the VMI to place the emulator thread on it. + + model + Model specifies the CPU model inside the VMI. List of available models + https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible + to specify special cases like "host-passthrough" to get the same CPU as the + node and "host-model" to get CPU closest to the node one. Defaults to + host-model. + + numa + NUMA allows specifying settings for the guest NUMA topology + + realtime + Realtime instructs the virt-launcher to tune the VMI for lower latency, + optional for real time workloads + + gpus(List[Any]): Optionally defines any GPU devices associated with the instancetype. + + FIELDS: + deviceName -required- + + + name -required- + Name of the GPU device as exposed by a device plugin + + tag + If specified, the virtual network interface address and its tag will be + provided to the guest via config drive + + virtualGPUOptions + + + host_devices(List[Any]): Optionally defines any HostDevices associated with the instancetype. + + FIELDS: + deviceName -required- + DeviceName is the resource name of the host device exposed by a device + plugin + + name -required- + + + tag + If specified, the virtual network interface address and its tag will be + provided to the guest via config drive + + io_threads_policy(str): Optionally defines the IOThreadsPolicy to be used by the instancetype. + + launch_security(Dict[Any, Any]): Optionally defines the LaunchSecurity to be used by the instancetype. + + FIELDS: + sev + AMD Secure Encrypted Virtualization (SEV). + + memory(Dict[Any, Any]): Required Memory related attributes of the instancetype. + + FIELDS: + guest -required- + Required amount of memory which is visible inside the guest OS. + + hugepages + Optionally enables the use of hugepages for the VirtualMachineInstance + instead of regular memory. + + overcommitPercent + OvercommitPercent is the percentage of the guest memory which will be + overcommitted. This means that the VMIs parent pod (virt-launcher) will + request less physical memory by a factor specified by the OvercommitPercent. + Overcommits can lead to memory exhaustion, which in turn can lead to + crashes. Use carefully. Defaults to 0 + + node_selector(Dict[Any, Any]): NodeSelector is a selector which must be true for the vmi to fit on a node. + Selector which must match a node's labels for the vmi to be scheduled on + that node. More info: + https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + NodeSelector is the name of the custom node selector for the instancetype. + + scheduler_name(str): If specified, the VMI will be dispatched by specified scheduler. If not + specified, the VMI will be dispatched by default scheduler. + SchedulerName is the name of the custom K8s scheduler for the instancetype. + + """ super().__init__(**kwargs) + + self.annotations = annotations + self.cpu = cpu + self.gpus = gpus + self.host_devices = host_devices + self.io_threads_policy = io_threads_policy + self.launch_security = launch_security + self.memory = memory + self.node_selector = node_selector + self.scheduler_name = scheduler_name + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + if not all([ + self.cpu, + self.memory, + ]): + raise MissingRequiredArgumentError(argument="cpu, memory") + + self.res["spec"] = {} + _spec = self.res["spec"] + + self.res["cpu"] = self.cpu + self.res["memory"] = self.memory + + if self.annotations: + _spec["annotations"] = self.annotations + + if self.gpus: + _spec["gpus"] = self.gpus + + if self.host_devices: + _spec["hostDevices"] = self.host_devices + + if self.io_threads_policy: + _spec["ioThreadsPolicy"] = self.io_threads_policy + + if self.launch_security: + _spec["launchSecurity"] = self.launch_security + + if self.node_selector: + _spec["nodeSelector"] = self.node_selector + + if self.scheduler_name: + _spec["schedulerName"] = self.scheduler_name diff --git a/ocp_resources/virtual_machine_cluster_preference.py b/ocp_resources/virtual_machine_cluster_preference.py new file mode 100644 index 0000000000..a400de8f88 --- /dev/null +++ b/ocp_resources/virtual_machine_cluster_preference.py @@ -0,0 +1,281 @@ +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, Dict, Optional +from ocp_resources.resource import Resource + + +class VirtualMachineClusterPreference(Resource): + """ + VirtualMachineClusterPreference is a cluster scoped version of the + VirtualMachinePreference resource. + """ + + api_group: str = Resource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO + + def __init__( + self, + annotations: Optional[Dict[str, Any]] = None, + clock: Optional[Dict[str, Any]] = None, + cpu: Optional[Dict[str, Any]] = None, + devices: Optional[Dict[str, Any]] = None, + features: Optional[Dict[str, Any]] = None, + firmware: Optional[Dict[str, Any]] = None, + machine: Optional[Dict[str, Any]] = None, + prefer_spread_socket_to_core_ratio: Optional[int] = None, + preferred_subdomain: Optional[str] = "", + preferred_termination_grace_period_seconds: Optional[int] = None, + requirements: Optional[Dict[str, Any]] = None, + volumes: Optional[Dict[str, Any]] = None, + **kwargs: Any, + ) -> None: + """ + Args: + annotations(Dict[Any, Any]): Optionally defines preferred Annotations to be applied to the + VirtualMachineInstance + + clock(Dict[Any, Any]): Clock optionally defines preferences associated with the Clock attribute of + a VirtualMachineInstance DomainSpec + + FIELDS: + preferredClockOffset + ClockOffset allows specifying the UTC offset or the timezone of the guest + clock. + + preferredTimer + Timer specifies whih timers are attached to the vmi. + + cpu(Dict[Any, Any]): CPU optionally defines preferences associated with the CPU attribute of a + VirtualMachineInstance DomainSpec + + FIELDS: + preferredCPUFeatures <[]Object> + PreferredCPUFeatures optionally defines a slice of preferred CPU features. + + preferredCPUTopology + PreferredCPUTopology optionally defines the preferred guest visible CPU + topology, defaults to PreferSockets. + + devices(Dict[Any, Any]): Devices optionally defines preferences associated with the Devices attribute + of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredAutoattachGraphicsDevice + PreferredAutoattachGraphicsDevice optionally defines the preferred value of + AutoattachGraphicsDevice + + preferredAutoattachInputDevice + PreferredAutoattachInputDevice optionally defines the preferred value of + AutoattachInputDevice + + preferredAutoattachMemBalloon + PreferredAutoattachMemBalloon optionally defines the preferred value of + AutoattachMemBalloon + + preferredAutoattachPodInterface + PreferredAutoattachPodInterface optionally defines the preferred value of + AutoattachPodInterface + + preferredAutoattachSerialConsole + PreferredAutoattachSerialConsole optionally defines the preferred value of + AutoattachSerialConsole + + preferredBlockMultiQueue + PreferredBlockMultiQueue optionally enables the vhost multiqueue feature for + virtio disks. + + preferredCdromBus + PreferredCdromBus optionally defines the preferred bus for Cdrom Disk + devices. + + preferredDisableHotplug + PreferredDisableHotplug optionally defines the preferred value of + DisableHotplug + + preferredDiskBlockSize + PreferredBlockSize optionally defines the block size of Disk devices. + + preferredDiskBus + PreferredDiskBus optionally defines the preferred bus for Disk Disk devices. + + preferredDiskCache + PreferredCache optionally defines the DriverCache to be used by Disk + devices. + + preferredDiskDedicatedIoThread + PreferredDedicatedIoThread optionally enables dedicated IO threads for Disk + devices using the virtio bus. + + preferredDiskIO + PreferredIo optionally defines the QEMU disk IO mode to be used by Disk + devices. + + preferredInputBus + PreferredInputBus optionally defines the preferred bus for Input devices. + + preferredInputType + PreferredInputType optionally defines the preferred type for Input devices. + + preferredInterfaceMasquerade + PreferredInterfaceMasquerade optionally defines the preferred masquerade + configuration to use with each network interface. + + preferredInterfaceModel + PreferredInterfaceModel optionally defines the preferred model to be used by + Interface devices. + + preferredLunBus + PreferredLunBus optionally defines the preferred bus for Lun Disk devices. + + preferredNetworkInterfaceMultiQueue + PreferredNetworkInterfaceMultiQueue optionally enables the vhost multiqueue + feature for virtio interfaces. + + preferredRng + PreferredRng optionally defines the preferred rng device to be used. + + preferredSoundModel + PreferredSoundModel optionally defines the preferred model for Sound + devices. + + preferredTPM + PreferredTPM optionally defines the preferred TPM device to be used. + + preferredUseVirtioTransitional + PreferredUseVirtioTransitional optionally defines the preferred value of + UseVirtioTransitional + + preferredVirtualGPUOptions + PreferredVirtualGPUOptions optionally defines the preferred value of + VirtualGPUOptions + + features(Dict[Any, Any]): Features optionally defines preferences associated with the Features + attribute of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredAcpi + PreferredAcpi optionally enables the ACPI feature + + preferredApic + PreferredApic optionally enables and configures the APIC feature + + preferredHyperv + PreferredHyperv optionally enables and configures HyperV features + + preferredKvm + PreferredKvm optionally enables and configures KVM features + + preferredPvspinlock + PreferredPvspinlock optionally enables the Pvspinlock feature + + preferredSmm + PreferredSmm optionally enables the SMM feature + + firmware(Dict[Any, Any]): Firmware optionally defines preferences associated with the Firmware + attribute of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredUseBios + PreferredUseBios optionally enables BIOS + + preferredUseBiosSerial + PreferredUseBiosSerial optionally transmitts BIOS output over the serial. + Requires PreferredUseBios to be enabled. + + preferredUseEfi + PreferredUseEfi optionally enables EFI + + preferredUseSecureBoot + PreferredUseSecureBoot optionally enables SecureBoot and the OVMF roms will + be swapped for SecureBoot-enabled ones. + Requires PreferredUseEfi and PreferredSmm to be enabled. + + machine(Dict[Any, Any]): Machine optionally defines preferences associated with the Machine attribute + of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredMachineType + PreferredMachineType optionally defines the preferred machine type to use. + + prefer_spread_socket_to_core_ratio(int): PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between + cores and sockets, it defaults to 2. + + preferred_subdomain(str): Subdomain of the VirtualMachineInstance + + preferred_termination_grace_period_seconds(int): Grace period observed after signalling a VirtualMachineInstance to stop + after which the VirtualMachineInstance is force terminated. + + requirements(Dict[Any, Any]): Requirements defines the minium amount of instance type defined resources + required by a set of preferences + + FIELDS: + cpu + Required CPU related attributes of the instancetype. + + memory + Required Memory related attributes of the instancetype. + + volumes(Dict[Any, Any]): Volumes optionally defines preferences associated with the Volumes attribute + of a VirtualMachineInstace DomainSpec + + FIELDS: + preferredStorageClassName + PreffereedStorageClassName optionally defines the preferred storageClass + + """ + super().__init__(**kwargs) + + self.annotations = annotations + self.clock = clock + self.cpu = cpu + self.devices = devices + self.features = features + self.firmware = firmware + self.machine = machine + self.prefer_spread_socket_to_core_ratio = prefer_spread_socket_to_core_ratio + self.preferred_subdomain = preferred_subdomain + self.preferred_termination_grace_period_seconds = preferred_termination_grace_period_seconds + self.requirements = requirements + self.volumes = volumes + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + self.res["spec"] = {} + _spec = self.res["spec"] + + if self.annotations: + _spec["annotations"] = self.annotations + + if self.clock: + _spec["clock"] = self.clock + + if self.cpu: + _spec["cpu"] = self.cpu + + if self.devices: + _spec["devices"] = self.devices + + if self.features: + _spec["features"] = self.features + + if self.firmware: + _spec["firmware"] = self.firmware + + if self.machine: + _spec["machine"] = self.machine + + if self.prefer_spread_socket_to_core_ratio: + _spec["preferSpreadSocketToCoreRatio"] = self.prefer_spread_socket_to_core_ratio + + if self.preferred_subdomain: + _spec["preferredSubdomain"] = self.preferred_subdomain + + if self.preferred_termination_grace_period_seconds: + _spec["preferredTerminationGracePeriodSeconds"] = self.preferred_termination_grace_period_seconds + + if self.requirements: + _spec["requirements"] = self.requirements + + if self.volumes: + _spec["volumes"] = self.volumes diff --git a/ocp_resources/virtual_machine_cluster_preferences.py b/ocp_resources/virtual_machine_cluster_preferences.py index 117c8aef8f..159f873176 100644 --- a/ocp_resources/virtual_machine_cluster_preferences.py +++ b/ocp_resources/virtual_machine_cluster_preferences.py @@ -1,5 +1,8 @@ -from ocp_resources.resource import Resource +from warnings import warn +from ocp_resources.virtual_machine_cluster_preference import VirtualMachineClusterPreference # noqa: F401 - -class VirtualMachineClusterPreference(Resource): - api_group = Resource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO +warn( + f"The module {__name__} is deprecated and will be removed in version 4.17, `VirtualMachineClusterPreference` should be imported from `ocp_resources.virtual_machine_cluster_preference`", + DeprecationWarning, + stacklevel=2, +) diff --git a/ocp_resources/virtual_machine_instance_migration.py b/ocp_resources/virtual_machine_instance_migration.py index e2f22e715c..7dfebdf8db 100644 --- a/ocp_resources/virtual_machine_instance_migration.py +++ b/ocp_resources/virtual_machine_instance_migration.py @@ -1,36 +1,38 @@ -from ocp_resources.constants import TIMEOUT_4MINUTES +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, Optional from ocp_resources.resource import NamespacedResource class VirtualMachineInstanceMigration(NamespacedResource): - api_group = NamespacedResource.ApiGroup.KUBEVIRT_IO + """ + VirtualMachineInstanceMigration represents the object tracking a VMI's + migration to another host in the cluster + """ + + api_group: str = NamespacedResource.ApiGroup.KUBEVIRT_IO def __init__( self, - name=None, - namespace=None, - vmi=None, - client=None, - teardown=True, - yaml_file=None, - delete_timeout=TIMEOUT_4MINUTES, - **kwargs, - ): - super().__init__( - name=name, - namespace=namespace, - client=client, - teardown=teardown, - yaml_file=yaml_file, - delete_timeout=delete_timeout, - **kwargs, - ) - self._vmi = vmi + vmi_name: Optional[str] = "", + **kwargs: Any, + ) -> None: + """ + Args: + vmi_name(str): The name of the VMI to perform the migration on. VMI must exist in the + migration objects namespace + + """ + super().__init__(**kwargs) + + self.vmi_name = vmi_name def to_dict(self) -> None: - # When creating VirtualMachineInstanceMigration vmi is mandatory but when calling get() - # we cannot pass vmi. super().to_dict() + if not self.yaml_file: - assert self._vmi, "vmi is mandatory for create" - self.res["spec"] = {"vmiName": self._vmi.name} + self.res["spec"] = {} + _spec = self.res["spec"] + + if self.vmi_name: + _spec["vmiName"] = self.vmi_name diff --git a/ocp_resources/virtual_machine_instance_preset.py b/ocp_resources/virtual_machine_instance_preset.py index 410c475ebe..93539356fa 100644 --- a/ocp_resources/virtual_machine_instance_preset.py +++ b/ocp_resources/virtual_machine_instance_preset.py @@ -1,9 +1,97 @@ -from ocp_resources.resource import NamespacedResource +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, Dict, Optional +from ocp_resources.resource import NamespacedResource, MissingRequiredArgumentError class VirtualMachineInstancePreset(NamespacedResource): """ - VirtualMachineInstancePreset object. + Deprecated for removal in v2, please use VirtualMachineInstanceType and + VirtualMachinePreference instead. + VirtualMachineInstancePreset defines a VMI spec.domain to be applied to all + VMIs that match the provided label selector More info: + https://kubevirt.io/user-guide/virtual_machines/presets/#overrides """ - api_group = NamespacedResource.ApiGroup.KUBEVIRT_IO + api_group: str = NamespacedResource.ApiGroup.KUBEVIRT_IO + + def __init__( + self, + domain: Optional[Dict[str, Any]] = None, + selector: Optional[Dict[str, Any]] = None, + **kwargs: Any, + ) -> None: + """ + Args: + domain(Dict[Any, Any]): Domain is the same object type as contained in VirtualMachineInstanceSpec + + FIELDS: + chassis + Chassis specifies the chassis info passed to the domain. + + clock + Clock sets the clock and timers of the vmi. + + cpu + CPU allow specified the detailed CPU topology inside the vmi. + + devices -required- + Devices allows adding disks, network interfaces, and others + + features + Features like acpi, apic, hyperv, smm. + + firmware + Firmware. + + ioThreadsPolicy + Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy + disables use of IOThreads. One of: shared, auto + + launchSecurity + Launch Security setting of the vmi. + + machine + Machine type. + + memory + Memory allow specifying the VMI memory features. + + resources + Resources describes the Compute Resources required by this vmi. + + selector(Dict[Any, Any]): Selector is a label query over a set of VMIs. Required. + + FIELDS: + matchExpressions <[]Object> + matchExpressions is a list of label selector requirements. The requirements + are ANDed. + + matchLabels + matchLabels is a map of {key,value} pairs. A single {key,value} in the + matchLabels map is equivalent to an element of matchExpressions, whose key + field is "key", the operator is "In", and the values array contains only + "value". The requirements are ANDed. + + """ + super().__init__(**kwargs) + + self.domain = domain + self.selector = selector + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + if not all([ + self.selector, + ]): + raise MissingRequiredArgumentError(argument="selector") + + self.res["spec"] = {} + _spec = self.res["spec"] + + self.res["selector"] = self.selector + + if self.domain: + _spec["domain"] = self.domain diff --git a/ocp_resources/virtual_machine_instance_types.py b/ocp_resources/virtual_machine_instance_types.py index ab27b2ceef..04a7c3def3 100644 --- a/ocp_resources/virtual_machine_instance_types.py +++ b/ocp_resources/virtual_machine_instance_types.py @@ -1,5 +1,8 @@ -from ocp_resources.resource import NamespacedResource +from warnings import warn +from ocp_resources.virtual_machine_instancetype import VirtualMachineInstancetype # noqa: F401 - -class VirtualMachineInstancetype(NamespacedResource): - api_group = NamespacedResource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO +warn( + f"The module {__name__} is deprecated and will be removed in version 4.17, `VirtualMachineInstancetype` should be imported from `ocp_resources.virtual_machine_instancetype`", + DeprecationWarning, + stacklevel=2, +) diff --git a/ocp_resources/virtual_machine_instancetype.py b/ocp_resources/virtual_machine_instancetype.py new file mode 100644 index 0000000000..34c2bb44f1 --- /dev/null +++ b/ocp_resources/virtual_machine_instancetype.py @@ -0,0 +1,179 @@ +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, Dict, List, Optional +from ocp_resources.resource import NamespacedResource, MissingRequiredArgumentError + + +class VirtualMachineInstancetype(NamespacedResource): + """ + VirtualMachineInstancetype resource contains quantitative and resource + related VirtualMachine configuration that can be used by multiple + VirtualMachine resources. + """ + + api_group: str = NamespacedResource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO + + def __init__( + self, + annotations: Optional[Dict[str, Any]] = None, + cpu: Optional[Dict[str, Any]] = None, + gpus: Optional[List[Any]] = None, + host_devices: Optional[List[Any]] = None, + io_threads_policy: Optional[str] = "", + launch_security: Optional[Dict[str, Any]] = None, + memory: Optional[Dict[str, Any]] = None, + node_selector: Optional[Dict[str, Any]] = None, + scheduler_name: Optional[str] = "", + **kwargs: Any, + ) -> None: + """ + Args: + annotations(Dict[Any, Any]): Optionally defines the required Annotations to be used by the instance type + and applied to the VirtualMachineInstance + + cpu(Dict[Any, Any]): Required CPU related attributes of the instancetype. + + FIELDS: + dedicatedCPUPlacement + DedicatedCPUPlacement requests the scheduler to place the + VirtualMachineInstance on a node with enough dedicated pCPUs and pin the + vCPUs to it. + + guest -required- + Required number of vCPUs to expose to the guest. + The resulting CPU topology being derived from the optional + PreferredCPUTopology attribute of CPUPreferences that itself defaults to + PreferSockets. + + isolateEmulatorThread + IsolateEmulatorThread requests one more dedicated pCPU to be allocated for + the VMI to place the emulator thread on it. + + model + Model specifies the CPU model inside the VMI. List of available models + https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible + to specify special cases like "host-passthrough" to get the same CPU as the + node and "host-model" to get CPU closest to the node one. Defaults to + host-model. + + numa + NUMA allows specifying settings for the guest NUMA topology + + realtime + Realtime instructs the virt-launcher to tune the VMI for lower latency, + optional for real time workloads + + gpus(List[Any]): Optionally defines any GPU devices associated with the instancetype. + + FIELDS: + deviceName -required- + + + name -required- + Name of the GPU device as exposed by a device plugin + + tag + If specified, the virtual network interface address and its tag will be + provided to the guest via config drive + + virtualGPUOptions + + + host_devices(List[Any]): Optionally defines any HostDevices associated with the instancetype. + + FIELDS: + deviceName -required- + DeviceName is the resource name of the host device exposed by a device + plugin + + name -required- + + + tag + If specified, the virtual network interface address and its tag will be + provided to the guest via config drive + + io_threads_policy(str): Optionally defines the IOThreadsPolicy to be used by the instancetype. + + launch_security(Dict[Any, Any]): Optionally defines the LaunchSecurity to be used by the instancetype. + + FIELDS: + sev + AMD Secure Encrypted Virtualization (SEV). + + memory(Dict[Any, Any]): Required Memory related attributes of the instancetype. + + FIELDS: + guest -required- + Required amount of memory which is visible inside the guest OS. + + hugepages + Optionally enables the use of hugepages for the VirtualMachineInstance + instead of regular memory. + + overcommitPercent + OvercommitPercent is the percentage of the guest memory which will be + overcommitted. This means that the VMIs parent pod (virt-launcher) will + request less physical memory by a factor specified by the OvercommitPercent. + Overcommits can lead to memory exhaustion, which in turn can lead to + crashes. Use carefully. Defaults to 0 + + node_selector(Dict[Any, Any]): NodeSelector is a selector which must be true for the vmi to fit on a node. + Selector which must match a node's labels for the vmi to be scheduled on + that node. More info: + https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + NodeSelector is the name of the custom node selector for the instancetype. + + scheduler_name(str): If specified, the VMI will be dispatched by specified scheduler. If not + specified, the VMI will be dispatched by default scheduler. + SchedulerName is the name of the custom K8s scheduler for the instancetype. + + """ + super().__init__(**kwargs) + + self.annotations = annotations + self.cpu = cpu + self.gpus = gpus + self.host_devices = host_devices + self.io_threads_policy = io_threads_policy + self.launch_security = launch_security + self.memory = memory + self.node_selector = node_selector + self.scheduler_name = scheduler_name + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + if not all([ + self.cpu, + self.memory, + ]): + raise MissingRequiredArgumentError(argument="cpu, memory") + + self.res["spec"] = {} + _spec = self.res["spec"] + + self.res["cpu"] = self.cpu + self.res["memory"] = self.memory + + if self.annotations: + _spec["annotations"] = self.annotations + + if self.gpus: + _spec["gpus"] = self.gpus + + if self.host_devices: + _spec["hostDevices"] = self.host_devices + + if self.io_threads_policy: + _spec["ioThreadsPolicy"] = self.io_threads_policy + + if self.launch_security: + _spec["launchSecurity"] = self.launch_security + + if self.node_selector: + _spec["nodeSelector"] = self.node_selector + + if self.scheduler_name: + _spec["schedulerName"] = self.scheduler_name diff --git a/ocp_resources/virtual_machine_preference.py b/ocp_resources/virtual_machine_preference.py new file mode 100644 index 0000000000..b7750e6ea1 --- /dev/null +++ b/ocp_resources/virtual_machine_preference.py @@ -0,0 +1,281 @@ +# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md + +from typing import Any, Dict, Optional +from ocp_resources.resource import NamespacedResource + + +class VirtualMachinePreference(NamespacedResource): + """ + VirtualMachinePreference resource contains optional preferences related to + the VirtualMachine. + """ + + api_group: str = NamespacedResource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO + + def __init__( + self, + annotations: Optional[Dict[str, Any]] = None, + clock: Optional[Dict[str, Any]] = None, + cpu: Optional[Dict[str, Any]] = None, + devices: Optional[Dict[str, Any]] = None, + features: Optional[Dict[str, Any]] = None, + firmware: Optional[Dict[str, Any]] = None, + machine: Optional[Dict[str, Any]] = None, + prefer_spread_socket_to_core_ratio: Optional[int] = None, + preferred_subdomain: Optional[str] = "", + preferred_termination_grace_period_seconds: Optional[int] = None, + requirements: Optional[Dict[str, Any]] = None, + volumes: Optional[Dict[str, Any]] = None, + **kwargs: Any, + ) -> None: + """ + Args: + annotations(Dict[Any, Any]): Optionally defines preferred Annotations to be applied to the + VirtualMachineInstance + + clock(Dict[Any, Any]): Clock optionally defines preferences associated with the Clock attribute of + a VirtualMachineInstance DomainSpec + + FIELDS: + preferredClockOffset + ClockOffset allows specifying the UTC offset or the timezone of the guest + clock. + + preferredTimer + Timer specifies whih timers are attached to the vmi. + + cpu(Dict[Any, Any]): CPU optionally defines preferences associated with the CPU attribute of a + VirtualMachineInstance DomainSpec + + FIELDS: + preferredCPUFeatures <[]Object> + PreferredCPUFeatures optionally defines a slice of preferred CPU features. + + preferredCPUTopology + PreferredCPUTopology optionally defines the preferred guest visible CPU + topology, defaults to PreferSockets. + + devices(Dict[Any, Any]): Devices optionally defines preferences associated with the Devices attribute + of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredAutoattachGraphicsDevice + PreferredAutoattachGraphicsDevice optionally defines the preferred value of + AutoattachGraphicsDevice + + preferredAutoattachInputDevice + PreferredAutoattachInputDevice optionally defines the preferred value of + AutoattachInputDevice + + preferredAutoattachMemBalloon + PreferredAutoattachMemBalloon optionally defines the preferred value of + AutoattachMemBalloon + + preferredAutoattachPodInterface + PreferredAutoattachPodInterface optionally defines the preferred value of + AutoattachPodInterface + + preferredAutoattachSerialConsole + PreferredAutoattachSerialConsole optionally defines the preferred value of + AutoattachSerialConsole + + preferredBlockMultiQueue + PreferredBlockMultiQueue optionally enables the vhost multiqueue feature for + virtio disks. + + preferredCdromBus + PreferredCdromBus optionally defines the preferred bus for Cdrom Disk + devices. + + preferredDisableHotplug + PreferredDisableHotplug optionally defines the preferred value of + DisableHotplug + + preferredDiskBlockSize + PreferredBlockSize optionally defines the block size of Disk devices. + + preferredDiskBus + PreferredDiskBus optionally defines the preferred bus for Disk Disk devices. + + preferredDiskCache + PreferredCache optionally defines the DriverCache to be used by Disk + devices. + + preferredDiskDedicatedIoThread + PreferredDedicatedIoThread optionally enables dedicated IO threads for Disk + devices using the virtio bus. + + preferredDiskIO + PreferredIo optionally defines the QEMU disk IO mode to be used by Disk + devices. + + preferredInputBus + PreferredInputBus optionally defines the preferred bus for Input devices. + + preferredInputType + PreferredInputType optionally defines the preferred type for Input devices. + + preferredInterfaceMasquerade + PreferredInterfaceMasquerade optionally defines the preferred masquerade + configuration to use with each network interface. + + preferredInterfaceModel + PreferredInterfaceModel optionally defines the preferred model to be used by + Interface devices. + + preferredLunBus + PreferredLunBus optionally defines the preferred bus for Lun Disk devices. + + preferredNetworkInterfaceMultiQueue + PreferredNetworkInterfaceMultiQueue optionally enables the vhost multiqueue + feature for virtio interfaces. + + preferredRng + PreferredRng optionally defines the preferred rng device to be used. + + preferredSoundModel + PreferredSoundModel optionally defines the preferred model for Sound + devices. + + preferredTPM + PreferredTPM optionally defines the preferred TPM device to be used. + + preferredUseVirtioTransitional + PreferredUseVirtioTransitional optionally defines the preferred value of + UseVirtioTransitional + + preferredVirtualGPUOptions + PreferredVirtualGPUOptions optionally defines the preferred value of + VirtualGPUOptions + + features(Dict[Any, Any]): Features optionally defines preferences associated with the Features + attribute of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredAcpi + PreferredAcpi optionally enables the ACPI feature + + preferredApic + PreferredApic optionally enables and configures the APIC feature + + preferredHyperv + PreferredHyperv optionally enables and configures HyperV features + + preferredKvm + PreferredKvm optionally enables and configures KVM features + + preferredPvspinlock + PreferredPvspinlock optionally enables the Pvspinlock feature + + preferredSmm + PreferredSmm optionally enables the SMM feature + + firmware(Dict[Any, Any]): Firmware optionally defines preferences associated with the Firmware + attribute of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredUseBios + PreferredUseBios optionally enables BIOS + + preferredUseBiosSerial + PreferredUseBiosSerial optionally transmitts BIOS output over the serial. + Requires PreferredUseBios to be enabled. + + preferredUseEfi + PreferredUseEfi optionally enables EFI + + preferredUseSecureBoot + PreferredUseSecureBoot optionally enables SecureBoot and the OVMF roms will + be swapped for SecureBoot-enabled ones. + Requires PreferredUseEfi and PreferredSmm to be enabled. + + machine(Dict[Any, Any]): Machine optionally defines preferences associated with the Machine attribute + of a VirtualMachineInstance DomainSpec + + FIELDS: + preferredMachineType + PreferredMachineType optionally defines the preferred machine type to use. + + prefer_spread_socket_to_core_ratio(int): PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between + cores and sockets, it defaults to 2. + + preferred_subdomain(str): Subdomain of the VirtualMachineInstance + + preferred_termination_grace_period_seconds(int): Grace period observed after signalling a VirtualMachineInstance to stop + after which the VirtualMachineInstance is force terminated. + + requirements(Dict[Any, Any]): Requirements defines the minium amount of instance type defined resources + required by a set of preferences + + FIELDS: + cpu + Required CPU related attributes of the instancetype. + + memory + Required Memory related attributes of the instancetype. + + volumes(Dict[Any, Any]): Volumes optionally defines preferences associated with the Volumes attribute + of a VirtualMachineInstace DomainSpec + + FIELDS: + preferredStorageClassName + PreffereedStorageClassName optionally defines the preferred storageClass + + """ + super().__init__(**kwargs) + + self.annotations = annotations + self.clock = clock + self.cpu = cpu + self.devices = devices + self.features = features + self.firmware = firmware + self.machine = machine + self.prefer_spread_socket_to_core_ratio = prefer_spread_socket_to_core_ratio + self.preferred_subdomain = preferred_subdomain + self.preferred_termination_grace_period_seconds = preferred_termination_grace_period_seconds + self.requirements = requirements + self.volumes = volumes + + def to_dict(self) -> None: + super().to_dict() + + if not self.yaml_file: + self.res["spec"] = {} + _spec = self.res["spec"] + + if self.annotations: + _spec["annotations"] = self.annotations + + if self.clock: + _spec["clock"] = self.clock + + if self.cpu: + _spec["cpu"] = self.cpu + + if self.devices: + _spec["devices"] = self.devices + + if self.features: + _spec["features"] = self.features + + if self.firmware: + _spec["firmware"] = self.firmware + + if self.machine: + _spec["machine"] = self.machine + + if self.prefer_spread_socket_to_core_ratio: + _spec["preferSpreadSocketToCoreRatio"] = self.prefer_spread_socket_to_core_ratio + + if self.preferred_subdomain: + _spec["preferredSubdomain"] = self.preferred_subdomain + + if self.preferred_termination_grace_period_seconds: + _spec["preferredTerminationGracePeriodSeconds"] = self.preferred_termination_grace_period_seconds + + if self.requirements: + _spec["requirements"] = self.requirements + + if self.volumes: + _spec["volumes"] = self.volumes diff --git a/ocp_resources/virtual_machine_preferences.py b/ocp_resources/virtual_machine_preferences.py index aef35d9943..159f873176 100644 --- a/ocp_resources/virtual_machine_preferences.py +++ b/ocp_resources/virtual_machine_preferences.py @@ -1,5 +1,8 @@ -from ocp_resources.resource import NamespacedResource +from warnings import warn +from ocp_resources.virtual_machine_cluster_preference import VirtualMachineClusterPreference # noqa: F401 - -class VirtualMachinePreference(NamespacedResource): - api_group = NamespacedResource.ApiGroup.INSTANCETYPE_KUBEVIRT_IO +warn( + f"The module {__name__} is deprecated and will be removed in version 4.17, `VirtualMachineClusterPreference` should be imported from `ocp_resources.virtual_machine_cluster_preference`", + DeprecationWarning, + stacklevel=2, +)