From f9286903697269b32df2e15b36eb329af3301612 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 22 Mar 2017 18:08:02 -0400 Subject: [PATCH] Initial commit --- .travis.yml | 29 + README.md | 38 + defaults/main.yml | 2 + .../k8s_v1_applied_cluster_resource_quota.py | 431 ++ ..._v1_applied_cluster_resource_quota_list.py | 420 ++ library/k8s_v1_binding.py | 358 ++ library/k8s_v1_build.py | 2120 +++++++++ library/k8s_v1_build_config.py | 1947 ++++++++ library/k8s_v1_build_config_list.py | 1448 ++++++ library/k8s_v1_build_list.py | 1629 +++++++ library/k8s_v1_build_request.py | 840 ++++ library/k8s_v1_cluster_network.py | 322 ++ library/k8s_v1_cluster_network_list.py | 329 ++ library/k8s_v1_cluster_policy.py | 540 +++ library/k8s_v1_cluster_policy_binding.py | 676 +++ library/k8s_v1_cluster_policy_binding_list.py | 663 +++ library/k8s_v1_cluster_policy_list.py | 566 +++ library/k8s_v1_cluster_resource_quota.py | 443 ++ library/k8s_v1_cluster_resource_quota_list.py | 432 ++ library/k8s_v1_cluster_role.py | 344 ++ library/k8s_v1_cluster_role_binding.py | 452 ++ library/k8s_v1_cluster_role_binding_list.py | 414 ++ library/k8s_v1_cluster_role_list.py | 362 ++ library/k8s_v1_component_status.py | 305 ++ library/k8s_v1_component_status_list.py | 322 ++ library/k8s_v1_config_map.py | 300 ++ library/k8s_v1_config_map_list.py | 316 ++ library/k8s_v1_deployment_config.py | 2751 +++++++++++ library/k8s_v1_deployment_config_list.py | 2431 ++++++++++ library/k8s_v1_deployment_config_rollback.py | 257 ++ library/k8s_v1_egress_network_policy.py | 318 ++ library/k8s_v1_egress_network_policy_list.py | 333 ++ library/k8s_v1_endpoints.py | 455 ++ library/k8s_v1_endpoints_list.py | 472 ++ library/k8s_v1_event.py | 436 ++ library/k8s_v1_event_list.py | 394 ++ library/k8s_v1_group.py | 298 ++ library/k8s_v1_group_list.py | 315 ++ library/k8s_v1_horizontal_pod_autoscaler.py | 394 ++ .../k8s_v1_horizontal_pod_autoscaler_list.py | 379 ++ library/k8s_v1_host_subnet.py | 313 ++ library/k8s_v1_host_subnet_list.py | 325 ++ library/k8s_v1_identity.py | 394 ++ library/k8s_v1_identity_list.py | 366 ++ library/k8s_v1_image.py | 647 +++ library/k8s_v1_image_list.py | 634 +++ library/k8s_v1_image_signature.py | 424 ++ library/k8s_v1_image_stream.py | 495 ++ library/k8s_v1_image_stream_image.py | 868 ++++ library/k8s_v1_image_stream_import.py | 2330 ++++++++++ library/k8s_v1_image_stream_list.py | 508 +++ library/k8s_v1_image_stream_mapping.py | 875 ++++ library/k8s_v1_image_stream_tag.py | 1129 +++++ library/k8s_v1_image_stream_tag_list.py | 969 ++++ library/k8s_v1_job.py | 2486 ++++++++++ library/k8s_v1_job_list.py | 2306 ++++++++++ library/k8s_v1_limit_range.py | 339 ++ library/k8s_v1_limit_range_list.py | 354 ++ library/k8s_v1_namespace.py | 367 ++ library/k8s_v1_namespace_list.py | 330 ++ library/k8s_v1_net_namespace.py | 309 ++ library/k8s_v1_net_namespace_list.py | 321 ++ library/k8s_v1_node.py | 497 ++ library/k8s_v1_node_list.py | 496 ++ library/k8s_v1_o_auth_access_token.py | 348 ++ library/k8s_v1_o_auth_access_token_list.py | 343 ++ library/k8s_v1_o_auth_authorize_token.py | 349 ++ library/k8s_v1_o_auth_authorize_token_list.py | 350 ++ library/k8s_v1_o_auth_client.py | 383 ++ library/k8s_v1_o_auth_client_authorization.py | 321 ++ ...k8s_v1_o_auth_client_authorization_list.py | 328 ++ library/k8s_v1_o_auth_client_list.py | 375 ++ library/k8s_v1_persistent_volume.py | 1268 ++++++ library/k8s_v1_persistent_volume_claim.py | 419 ++ .../k8s_v1_persistent_volume_claim_list.py | 401 ++ library/k8s_v1_persistent_volume_list.py | 846 ++++ library/k8s_v1_pod.py | 2266 +++++++++ library/k8s_v1_pod_list.py | 2146 +++++++++ library/k8s_v1_pod_security_policy_review.py | 4051 +++++++++++++++++ ...pod_security_policy_self_subject_review.py | 3974 ++++++++++++++++ ...s_v1_pod_security_policy_subject_review.py | 4001 ++++++++++++++++ library/k8s_v1_pod_template.py | 2255 +++++++++ library/k8s_v1_pod_template_list.py | 2121 +++++++++ library/k8s_v1_policy.py | 540 +++ library/k8s_v1_policy_binding.py | 676 +++ library/k8s_v1_policy_binding_list.py | 663 +++ library/k8s_v1_policy_list.py | 565 +++ library/k8s_v1_project.py | 331 ++ library/k8s_v1_project_list.py | 330 ++ library/k8s_v1_replication_controller.py | 2403 ++++++++++ library/k8s_v1_replication_controller_list.py | 2254 +++++++++ library/k8s_v1_resource_quota.py | 333 ++ library/k8s_v1_resource_quota_list.py | 341 ++ library/k8s_v1_role.py | 344 ++ library/k8s_v1_role_binding.py | 452 ++ library/k8s_v1_role_binding_list.py | 414 ++ library/k8s_v1_role_binding_restriction.py | 463 ++ .../k8s_v1_role_binding_restriction_list.py | 443 ++ library/k8s_v1_role_list.py | 362 ++ library/k8s_v1_route.py | 613 +++ library/k8s_v1_route_list.py | 490 ++ library/k8s_v1_scale.py | 308 ++ library/k8s_v1_secret.py | 326 ++ library/k8s_v1_secret_list.py | 330 ++ .../k8s_v1_security_context_constraints.py | 638 +++ ...8s_v1_security_context_constraints_list.py | 509 +++ library/k8s_v1_self_subject_rules_review.py | 183 + library/k8s_v1_service.py | 607 +++ library/k8s_v1_service_account.py | 354 ++ library/k8s_v1_service_account_list.py | 364 ++ library/k8s_v1_service_list.py | 466 ++ library/k8s_v1_subject_rules_review.py | 205 + library/k8s_v1_template.py | 381 ++ library/k8s_v1_template_list.py | 383 ++ library/k8s_v1_user.py | 318 ++ library/k8s_v1_user_identity_mapping.py | 451 ++ library/k8s_v1_user_list.py | 326 ++ ...8s_v1alpha1_certificate_signing_request.py | 359 ++ ...alpha1_certificate_signing_request_list.py | 360 ++ library/k8s_v1beta1_daemon_set.py | 2382 ++++++++++ library/k8s_v1beta1_daemon_set_list.py | 2239 +++++++++ library/k8s_v1beta1_deployment.py | 2549 +++++++++++ library/k8s_v1beta1_deployment_list.py | 2357 ++++++++++ library/k8s_v1beta1_eviction.py | 352 ++ .../k8s_v1beta1_horizontal_pod_autoscaler.py | 409 ++ ..._v1beta1_horizontal_pod_autoscaler_list.py | 389 ++ library/k8s_v1beta1_ingress.py | 436 ++ library/k8s_v1beta1_ingress_list.py | 437 ++ library/k8s_v1beta1_job.py | 2479 ++++++++++ library/k8s_v1beta1_job_list.py | 2302 ++++++++++ library/k8s_v1beta1_network_policy.py | 492 ++ library/k8s_v1beta1_network_policy_list.py | 490 ++ library/k8s_v1beta1_pod_disruption_budget.py | 396 ++ .../k8s_v1beta1_pod_disruption_budget_list.py | 400 ++ library/k8s_v1beta1_pod_security_policy.py | 603 +++ .../k8s_v1beta1_pod_security_policy_list.py | 492 ++ library/k8s_v1beta1_replica_set.py | 2438 ++++++++++ library/k8s_v1beta1_replica_set_list.py | 2280 ++++++++++ library/k8s_v1beta1_scale.py | 315 ++ library/k8s_v1beta1_stateful_set.py | 2688 +++++++++++ library/k8s_v1beta1_stateful_set_list.py | 2525 ++++++++++ library/k8s_v1beta1_storage_class.py | 307 ++ library/k8s_v1beta1_storage_class_list.py | 320 ++ library/k8s_v1beta1_third_party_resource.py | 309 ++ .../k8s_v1beta1_third_party_resource_list.py | 323 ++ library/k8s_v1beta1_token_review.py | 329 ++ library/k8s_v2alpha1_cron_job.py | 2795 ++++++++++++ library/k8s_v2alpha1_cron_job_list.py | 2630 +++++++++++ library/k8s_v2alpha1_job.py | 2486 ++++++++++ library/k8s_v2alpha1_job_list.py | 2306 ++++++++++ meta/main.yml | 222 + requirements.txt | 1 + tasks/main.yml | 8 + tests/KubeObjHelper.log | 2392 ++++++++++ tests/ansible.cfg | 2 + tests/inventory | 1 + tests/roles/hello-world/tasks/main.yml | 62 + tests/test.retry | 1 + tests/test.yml | 7 + 159 files changed, 132744 insertions(+) create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 library/k8s_v1_applied_cluster_resource_quota.py create mode 100644 library/k8s_v1_applied_cluster_resource_quota_list.py create mode 100644 library/k8s_v1_binding.py create mode 100644 library/k8s_v1_build.py create mode 100644 library/k8s_v1_build_config.py create mode 100644 library/k8s_v1_build_config_list.py create mode 100644 library/k8s_v1_build_list.py create mode 100644 library/k8s_v1_build_request.py create mode 100644 library/k8s_v1_cluster_network.py create mode 100644 library/k8s_v1_cluster_network_list.py create mode 100644 library/k8s_v1_cluster_policy.py create mode 100644 library/k8s_v1_cluster_policy_binding.py create mode 100644 library/k8s_v1_cluster_policy_binding_list.py create mode 100644 library/k8s_v1_cluster_policy_list.py create mode 100644 library/k8s_v1_cluster_resource_quota.py create mode 100644 library/k8s_v1_cluster_resource_quota_list.py create mode 100644 library/k8s_v1_cluster_role.py create mode 100644 library/k8s_v1_cluster_role_binding.py create mode 100644 library/k8s_v1_cluster_role_binding_list.py create mode 100644 library/k8s_v1_cluster_role_list.py create mode 100644 library/k8s_v1_component_status.py create mode 100644 library/k8s_v1_component_status_list.py create mode 100644 library/k8s_v1_config_map.py create mode 100644 library/k8s_v1_config_map_list.py create mode 100644 library/k8s_v1_deployment_config.py create mode 100644 library/k8s_v1_deployment_config_list.py create mode 100644 library/k8s_v1_deployment_config_rollback.py create mode 100644 library/k8s_v1_egress_network_policy.py create mode 100644 library/k8s_v1_egress_network_policy_list.py create mode 100644 library/k8s_v1_endpoints.py create mode 100644 library/k8s_v1_endpoints_list.py create mode 100644 library/k8s_v1_event.py create mode 100644 library/k8s_v1_event_list.py create mode 100644 library/k8s_v1_group.py create mode 100644 library/k8s_v1_group_list.py create mode 100644 library/k8s_v1_horizontal_pod_autoscaler.py create mode 100644 library/k8s_v1_horizontal_pod_autoscaler_list.py create mode 100644 library/k8s_v1_host_subnet.py create mode 100644 library/k8s_v1_host_subnet_list.py create mode 100644 library/k8s_v1_identity.py create mode 100644 library/k8s_v1_identity_list.py create mode 100644 library/k8s_v1_image.py create mode 100644 library/k8s_v1_image_list.py create mode 100644 library/k8s_v1_image_signature.py create mode 100644 library/k8s_v1_image_stream.py create mode 100644 library/k8s_v1_image_stream_image.py create mode 100644 library/k8s_v1_image_stream_import.py create mode 100644 library/k8s_v1_image_stream_list.py create mode 100644 library/k8s_v1_image_stream_mapping.py create mode 100644 library/k8s_v1_image_stream_tag.py create mode 100644 library/k8s_v1_image_stream_tag_list.py create mode 100644 library/k8s_v1_job.py create mode 100644 library/k8s_v1_job_list.py create mode 100644 library/k8s_v1_limit_range.py create mode 100644 library/k8s_v1_limit_range_list.py create mode 100644 library/k8s_v1_namespace.py create mode 100644 library/k8s_v1_namespace_list.py create mode 100644 library/k8s_v1_net_namespace.py create mode 100644 library/k8s_v1_net_namespace_list.py create mode 100644 library/k8s_v1_node.py create mode 100644 library/k8s_v1_node_list.py create mode 100644 library/k8s_v1_o_auth_access_token.py create mode 100644 library/k8s_v1_o_auth_access_token_list.py create mode 100644 library/k8s_v1_o_auth_authorize_token.py create mode 100644 library/k8s_v1_o_auth_authorize_token_list.py create mode 100644 library/k8s_v1_o_auth_client.py create mode 100644 library/k8s_v1_o_auth_client_authorization.py create mode 100644 library/k8s_v1_o_auth_client_authorization_list.py create mode 100644 library/k8s_v1_o_auth_client_list.py create mode 100644 library/k8s_v1_persistent_volume.py create mode 100644 library/k8s_v1_persistent_volume_claim.py create mode 100644 library/k8s_v1_persistent_volume_claim_list.py create mode 100644 library/k8s_v1_persistent_volume_list.py create mode 100644 library/k8s_v1_pod.py create mode 100644 library/k8s_v1_pod_list.py create mode 100644 library/k8s_v1_pod_security_policy_review.py create mode 100644 library/k8s_v1_pod_security_policy_self_subject_review.py create mode 100644 library/k8s_v1_pod_security_policy_subject_review.py create mode 100644 library/k8s_v1_pod_template.py create mode 100644 library/k8s_v1_pod_template_list.py create mode 100644 library/k8s_v1_policy.py create mode 100644 library/k8s_v1_policy_binding.py create mode 100644 library/k8s_v1_policy_binding_list.py create mode 100644 library/k8s_v1_policy_list.py create mode 100644 library/k8s_v1_project.py create mode 100644 library/k8s_v1_project_list.py create mode 100644 library/k8s_v1_replication_controller.py create mode 100644 library/k8s_v1_replication_controller_list.py create mode 100644 library/k8s_v1_resource_quota.py create mode 100644 library/k8s_v1_resource_quota_list.py create mode 100644 library/k8s_v1_role.py create mode 100644 library/k8s_v1_role_binding.py create mode 100644 library/k8s_v1_role_binding_list.py create mode 100644 library/k8s_v1_role_binding_restriction.py create mode 100644 library/k8s_v1_role_binding_restriction_list.py create mode 100644 library/k8s_v1_role_list.py create mode 100644 library/k8s_v1_route.py create mode 100644 library/k8s_v1_route_list.py create mode 100644 library/k8s_v1_scale.py create mode 100644 library/k8s_v1_secret.py create mode 100644 library/k8s_v1_secret_list.py create mode 100644 library/k8s_v1_security_context_constraints.py create mode 100644 library/k8s_v1_security_context_constraints_list.py create mode 100644 library/k8s_v1_self_subject_rules_review.py create mode 100644 library/k8s_v1_service.py create mode 100644 library/k8s_v1_service_account.py create mode 100644 library/k8s_v1_service_account_list.py create mode 100644 library/k8s_v1_service_list.py create mode 100644 library/k8s_v1_subject_rules_review.py create mode 100644 library/k8s_v1_template.py create mode 100644 library/k8s_v1_template_list.py create mode 100644 library/k8s_v1_user.py create mode 100644 library/k8s_v1_user_identity_mapping.py create mode 100644 library/k8s_v1_user_list.py create mode 100644 library/k8s_v1alpha1_certificate_signing_request.py create mode 100644 library/k8s_v1alpha1_certificate_signing_request_list.py create mode 100644 library/k8s_v1beta1_daemon_set.py create mode 100644 library/k8s_v1beta1_daemon_set_list.py create mode 100644 library/k8s_v1beta1_deployment.py create mode 100644 library/k8s_v1beta1_deployment_list.py create mode 100644 library/k8s_v1beta1_eviction.py create mode 100644 library/k8s_v1beta1_horizontal_pod_autoscaler.py create mode 100644 library/k8s_v1beta1_horizontal_pod_autoscaler_list.py create mode 100644 library/k8s_v1beta1_ingress.py create mode 100644 library/k8s_v1beta1_ingress_list.py create mode 100644 library/k8s_v1beta1_job.py create mode 100644 library/k8s_v1beta1_job_list.py create mode 100644 library/k8s_v1beta1_network_policy.py create mode 100644 library/k8s_v1beta1_network_policy_list.py create mode 100644 library/k8s_v1beta1_pod_disruption_budget.py create mode 100644 library/k8s_v1beta1_pod_disruption_budget_list.py create mode 100644 library/k8s_v1beta1_pod_security_policy.py create mode 100644 library/k8s_v1beta1_pod_security_policy_list.py create mode 100644 library/k8s_v1beta1_replica_set.py create mode 100644 library/k8s_v1beta1_replica_set_list.py create mode 100644 library/k8s_v1beta1_scale.py create mode 100644 library/k8s_v1beta1_stateful_set.py create mode 100644 library/k8s_v1beta1_stateful_set_list.py create mode 100644 library/k8s_v1beta1_storage_class.py create mode 100644 library/k8s_v1beta1_storage_class_list.py create mode 100644 library/k8s_v1beta1_third_party_resource.py create mode 100644 library/k8s_v1beta1_third_party_resource_list.py create mode 100644 library/k8s_v1beta1_token_review.py create mode 100644 library/k8s_v2alpha1_cron_job.py create mode 100644 library/k8s_v2alpha1_cron_job_list.py create mode 100644 library/k8s_v2alpha1_job.py create mode 100644 library/k8s_v2alpha1_job_list.py create mode 100644 meta/main.yml create mode 100644 requirements.txt create mode 100644 tasks/main.yml create mode 100644 tests/KubeObjHelper.log create mode 100644 tests/ansible.cfg create mode 100644 tests/inventory create mode 100644 tests/roles/hello-world/tasks/main.yml create mode 100644 tests/test.retry create mode 100644 tests/test.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..36bbf620 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +--- +language: python +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip + +install: + # Install ansible + - pip install ansible + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + +script: + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..225dd44b --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 00000000..d2a69e61 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +install_python_requirements: no diff --git a/library/k8s_v1_applied_cluster_resource_quota.py b/library/k8s_v1_applied_cluster_resource_quota.py new file mode 100644 index 00000000..1cbc62a2 --- /dev/null +++ b/library/k8s_v1_applied_cluster_resource_quota.py @@ -0,0 +1,431 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_applied_cluster_resource_quota +short_description: Kubernetes AppliedClusterResourceQuota +description: +- Manage the lifecycle of a applied_cluster_resource_quota object. Supports check + mode, and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_quota_hard: + description: + - Hard is the set of desired hard limits for each named resource. + aliases: + - quota_hard + type: dict + spec_quota_scopes: + description: + - A collection of filters that must match each object tracked by a quota. If not + specified, the quota matches all objects. + aliases: + - quota_scopes + type: list + spec_selector_annotations: + description: + - AnnotationSelector is used to select projects by annotation. + aliases: + - selector_annotations + type: dict + spec_selector_labels_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_labels_match_expressions + type: list + spec_selector_labels_match_labels: + description: + - 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. + aliases: + - selector_labels_match_labels + type: dict + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +applied_cluster_resource_quota: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired quota + type: complex + contains: + quota: + description: + - Quota defines the desired quota + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by a quota. + If not specified, the quota matches all objects. + type: list + contains: str + selector: + description: + - Selector is the selector used to match projects. It should only select + active projects on the scale of dozens (though it can select many more + less active projects). These projects will contend on object creation + through this resource. + type: complex + contains: + annotations: + description: + - AnnotationSelector is used to select projects by annotation. + type: complex + contains: str, str + labels: + description: + - LabelSelector is used to select projects by label. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Status defines the actual enforced quota and its current usage + type: complex + contains: + namespaces: + description: + - Namespaces slices the usage by project. This division allows for quick + resolution of deletion reconciliation inside of a single project without + requiring a recalculation across all projects. This can be used to pull + the deltas for a given project. + type: list + contains: + namespace: + description: + - Namespace the project this status applies to + type: str + status: + description: + - Status indicates how many resources have been consumed by this project + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the + namespace. + type: complex + contains: str, ResourceQuantity + total: + description: + - Total defines the actual enforced quota and its current usage across all + projects + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the namespace. + type: complex + contains: str, ResourceQuantity +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('applied_cluster_resource_quota', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_applied_cluster_resource_quota_list.py b/library/k8s_v1_applied_cluster_resource_quota_list.py new file mode 100644 index 00000000..c5081d89 --- /dev/null +++ b/library/k8s_v1_applied_cluster_resource_quota_list.py @@ -0,0 +1,420 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_applied_cluster_resource_quota_list +short_description: Kubernetes AppliedClusterResourceQuotaList +description: +- Retrieve a list of applied_cluster_resource_quotas. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +applied_cluster_resource_quota_list: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of AppliedClusterResourceQuota + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired quota + type: complex + contains: + quota: + description: + - Quota defines the desired quota + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by + a quota. If not specified, the quota matches all objects. + type: list + contains: str + selector: + description: + - Selector is the selector used to match projects. It should only select + active projects on the scale of dozens (though it can select many + more less active projects). These projects will contend on object + creation through this resource. + type: complex + contains: + annotations: + description: + - AnnotationSelector is used to select projects by annotation. + type: complex + contains: str, str + labels: + description: + - LabelSelector is used to select projects by label. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Status defines the actual enforced quota and its current usage + type: complex + contains: + namespaces: + description: + - Namespaces slices the usage by project. This division allows for quick + resolution of deletion reconciliation inside of a single project without + requiring a recalculation across all projects. This can be used to + pull the deltas for a given project. + type: list + contains: + namespace: + description: + - Namespace the project this status applies to + type: str + status: + description: + - Status indicates how many resources have been consumed by this + project + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in + the namespace. + type: complex + contains: str, ResourceQuantity + total: + description: + - Total defines the actual enforced quota and its current usage across + all projects + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the + namespace. + type: complex + contains: str, ResourceQuantity + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('applied_cluster_resource_quota_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_binding.py b/library/k8s_v1_binding.py new file mode 100644 index 00000000..dcd737cb --- /dev/null +++ b/library/k8s_v1_binding.py @@ -0,0 +1,358 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_binding +short_description: Kubernetes Binding +description: +- Manage the lifecycle of a binding object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + target_api_version: + description: + - API version of the referent. + aliases: + - api_version + target_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + target_kind: + description: + - Kind of the referent. + aliases: + - kind + target_name: + description: + - Name of the referent. + aliases: + - name + target_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + target_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + target_uid: + description: + - UID of the referent. + aliases: + - uid + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +binding: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + target: + description: + - The target object that you want to bind to the standard object. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('binding', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_build.py b/library/k8s_v1_build.py new file mode 100644 index 00000000..b6dc554b --- /dev/null +++ b/library/k8s_v1_build.py @@ -0,0 +1,2120 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_build +short_description: Kubernetes Build +description: +- Manage the lifecycle of a build object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted from the + time when a build pod gets scheduled in the system, that the build may be active + on a node before the system actively tries to terminate the build; value must + be positive integer + aliases: + - completion_deadline_seconds + type: int + spec_node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to fit on a + node If nil, it can be overridden by default build nodeselector values for the + cluster. If set to an empty map or a map with any values, default build nodeselector + values are ignored. + aliases: + - node_selector + type: dict + spec_output_image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting image. + If there are multiple labels with the same name then the last one in the list + is used. + aliases: + - output_image_labels + type: list + spec_output_push_secret_name: + description: + - Name of the referent. + aliases: + - output_push_secret_name + spec_output_to_api_version: + description: + - API version of the referent. + aliases: + - output_to_api_version + spec_output_to_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - output_to_field_path + spec_output_to_kind: + description: + - Kind of the referent. + aliases: + - output_to_kind + spec_output_to_name: + description: + - Name of the referent. + aliases: + - output_to_name + spec_output_to_namespace: + description: + - Namespace of the referent. + aliases: + - output_to_namespace + spec_output_to_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - output_to_resource_version + spec_output_to_uid: + description: + - UID of the referent. + aliases: + - output_to_uid + spec_post_commit_args: + description: + - args is a list of arguments that are provided to either Command, Script or the + Docker image's default entrypoint. The arguments are placed immediately after + the command to be run. + aliases: + - post_commit_args + type: list + spec_post_commit_command: + description: + - command is the command to run. It may not be specified with Script. This might + be needed if the image doesn't have `/bin/sh`, or if you do not want to use + a shell. In all other cases, using Script might be more convenient. + aliases: + - post_commit_command + type: list + spec_post_commit_script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may not be specified + with Command. Use Script when a shell script is appropriate to execute the post + build hook, for example for running unit tests with `rake test`. If you need + control over the image entrypoint, or if the image does not have `/bin/sh`, + use Command and/or Args. The `-i` flag is needed to support CentOS and RHEL + images that use Software Collections (SCL), in order to have the appropriate + collections enabled in the shell. E.g., in the Ruby image, this is necessary + to make `ruby`, `bundle` and other binaries available in the PATH. + aliases: + - post_commit_script + spec_resources_limits: + description: + - Limits describes the maximum amount of compute resources allowed. + aliases: + - resources_limits + type: dict + spec_resources_requests: + description: + - Requests describes the minimum amount of compute resources required. If Requests + is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + aliases: + - resources_requests + type: dict + spec_revision_git_author_email: + description: + - email of the source control user + aliases: + - revision_git_author_email + spec_revision_git_author_name: + description: + - name of the source control user + aliases: + - revision_git_author_name + spec_revision_git_commit: + description: + - commit is the commit hash identifying a specific commit + aliases: + - revision_git_commit + spec_revision_git_committer_email: + description: + - email of the source control user + aliases: + - revision_git_committer_email + spec_revision_git_committer_name: + description: + - name of the source control user + aliases: + - revision_git_committer_name + spec_revision_git_message: + description: + - message is the description of a specific commit + aliases: + - revision_git_message + spec_revision_type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or + 'Images' + aliases: + - revision_type + spec_service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the pod created + by this build. The pod will be allowed to use secrets referenced by the ServiceAccount + aliases: + - service_account + spec_source_binary_as_file: + description: + - asFile indicates that the provided binary input should be considered a single + file within the build input. For example, specifying "webapp.war" would place + the provided binary as `/webapp.war` for the builder. If left empty, the Docker + and Source build strategies assume this file is a zip, tar, or tar.gz file and + extract it as the source. The custom strategy receives this binary as standard + input. This filename may not contain slashes or be '..' or '.'. + aliases: + - source_binary_as_file + spec_source_context_dir: + description: + - contextDir specifies the sub-directory where the source code for the application + exists. This allows to have buildable sources in directory other than root of + repository. + aliases: + - source_context_dir + spec_source_dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be built. When this + option is specified, the FROM may be modified based on your strategy base image + and additional ENV stanzas from your strategy environment will be added after + the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source + type may be used with other options like git - in those cases the Git repo will + have any innate Dockerfile replaced in the context dir. + aliases: + - source_dockerfile + spec_source_git_http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over http + aliases: + - source_git_http_proxy + spec_source_git_https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over https + aliases: + - source_git_https_proxy + spec_source_git_no_proxy: + description: + - noProxy is the list of domains for which the proxy should not be used + aliases: + - source_git_no_proxy + spec_source_git_ref: + description: + - ref is the branch/tag/ref to build. + aliases: + - source_git_ref + spec_source_git_uri: + description: + - uri points to the source that will be built. The structure of the source will + depend on the type of build to run + aliases: + - source_git_uri + spec_source_images: + description: + - images describes a set of images to be used to provide source for the build + aliases: + - source_images + type: list + spec_source_secrets: + description: + - secrets represents a list of secrets and their destinations that will be used + only for the build. + aliases: + - source_secrets + type: list + spec_source_source_secret_name: + description: + - Name of the referent. + aliases: + - source_secret_name + spec_source_type: + description: + - type of build input to accept + aliases: + - source_type + spec_strategy_custom_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_custom_strategy__from_api_version + spec_strategy_custom_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_custom_strategy__from_field_path + spec_strategy_custom_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_custom_strategy__from_kind + spec_strategy_custom_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_custom_strategy__from_name + spec_strategy_custom_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_custom_strategy__from_namespace + spec_strategy_custom_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_custom_strategy__from_resource_version + spec_strategy_custom_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_custom_strategy__from_uid + spec_strategy_custom_strategy_build_api_version: + description: + - buildAPIVersion is the requested API version for the Build object serialized + and passed to the custom builder + aliases: + - strategy_custom_strategy_build_api_version + spec_strategy_custom_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_custom_strategy_env + type: list + spec_strategy_custom_strategy_expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and build Docker images) + from inside the Docker container. + aliases: + - strategy_custom_strategy_expose_docker_socket + type: bool + spec_strategy_custom_strategy_force_pull: + description: + - forcePull describes if the controller should configure the build pod to always + pull the images for the builder or only pull if it is not present locally + aliases: + - strategy_custom_strategy_force_pull + type: bool + spec_strategy_custom_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_custom_strategy_pull_secret_name + spec_strategy_custom_strategy_secrets: + description: + - secrets is a list of additional secrets that will be included in the build pod + aliases: + - strategy_custom_strategy_secrets + type: list + spec_strategy_docker_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_docker_strategy__from_api_version + spec_strategy_docker_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_docker_strategy__from_field_path + spec_strategy_docker_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_docker_strategy__from_kind + spec_strategy_docker_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_docker_strategy__from_name + spec_strategy_docker_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_docker_strategy__from_namespace + spec_strategy_docker_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_docker_strategy__from_resource_version + spec_strategy_docker_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_docker_strategy__from_uid + spec_strategy_docker_strategy_dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be used to build the + Docker image, relative to the root of the context (contextDir). + aliases: + - strategy_docker_strategy_dockerfile_path + spec_strategy_docker_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_docker_strategy_env + type: list + spec_strategy_docker_strategy_force_pull: + description: + - forcePull describes if the builder should pull the images from registry prior + to building. + aliases: + - strategy_docker_strategy_force_pull + type: bool + spec_strategy_docker_strategy_no_cache: + description: + - noCache if set to true indicates that the docker build must be executed with + the --no-cache=true flag + aliases: + - strategy_docker_strategy_no_cache + type: bool + spec_strategy_docker_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_docker_strategy_pull_secret_name + spec_strategy_jenkins_pipeline_strategy_jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines + a Jenkins pipeline build. + aliases: + - strategy_jenkins_pipeline_strategy_jenkinsfile + spec_strategy_jenkins_pipeline_strategy_jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that will be used to + configure the pipeline relative to the root of the context (contextDir). If + both JenkinsfilePath & Jenkinsfile are both not specified, this defaults to + Jenkinsfile in the root of the specified contextDir. + aliases: + - strategy_jenkins_pipeline_strategy_jenkinsfile_path + spec_strategy_source_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_source_strategy__from_api_version + spec_strategy_source_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_source_strategy__from_field_path + spec_strategy_source_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_source_strategy__from_kind + spec_strategy_source_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy__from_name + spec_strategy_source_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_source_strategy__from_namespace + spec_strategy_source_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_source_strategy__from_resource_version + spec_strategy_source_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_source_strategy__from_uid + spec_strategy_source_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_source_strategy_env + type: list + spec_strategy_source_strategy_force_pull: + description: + - forcePull describes if the builder should pull the images from registry prior + to building. + aliases: + - strategy_source_strategy_force_pull + type: bool + spec_strategy_source_strategy_incremental: + description: + - incremental flag forces the Source build to do incremental builds if true. + aliases: + - strategy_source_strategy_incremental + type: bool + spec_strategy_source_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy_pull_secret_name + spec_strategy_source_strategy_runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs that will be copied + from the builder to the runtime image. sourcePath can be a file or directory. + destinationDir must be a directory. destinationDir can also be empty or equal + to ".", in this case it just refers to the root of WORKDIR. This field and the + feature it enables are in tech preview. + aliases: + - strategy_source_strategy_runtime_artifacts + type: list + spec_strategy_source_strategy_runtime_image_api_version: + description: + - API version of the referent. + aliases: + - strategy_source_strategy_runtime_image_api_version + spec_strategy_source_strategy_runtime_image_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_source_strategy_runtime_image_field_path + spec_strategy_source_strategy_runtime_image_kind: + description: + - Kind of the referent. + aliases: + - strategy_source_strategy_runtime_image_kind + spec_strategy_source_strategy_runtime_image_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy_runtime_image_name + spec_strategy_source_strategy_runtime_image_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_source_strategy_runtime_image_namespace + spec_strategy_source_strategy_runtime_image_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_source_strategy_runtime_image_resource_version + spec_strategy_source_strategy_runtime_image_uid: + description: + - UID of the referent. + aliases: + - strategy_source_strategy_runtime_image_uid + spec_strategy_source_strategy_scripts: + description: + - scripts is the location of Source scripts + aliases: + - strategy_source_strategy_scripts + spec_strategy_type: + description: + - type is the kind of build strategy. + aliases: + - strategy_type + spec_triggered_by: + description: + - triggeredBy describes which triggers started the most recent update to the build + configuration and contains information about those triggers. + aliases: + - triggered_by + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +build: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - spec is all the inputs used to execute the build. + type: complex + contains: + completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted + from the time when a build pod gets scheduled in the system, that the + build may be active on a node before the system actively tries to terminate + the build; value must be positive integer + type: int + node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to fit + on a node If nil, it can be overridden by default build nodeselector values + for the cluster. If set to an empty map or a map with any values, default + build nodeselector values are ignored. + type: complex + contains: str, str + output: + description: + - output describes the Docker image the Strategy should produce. + type: complex + contains: + image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting + image. If there are multiple labels with the same name then the last + one in the list is used. + type: list + contains: + name: + description: + - name defines the name of the label. It must have non-zero length. + type: str + value: + description: + - value defines the literal value of the label. + type: str + push_secret: + description: + - PushSecret is the name of a Secret that would be used for setting + up the authentication for executing the Docker push to authentication + enabled Docker Registry (or Docker Hub). + type: complex + contains: + name: + description: + - Name of the referent. + type: str + to: + description: + - to defines an optional location to push the output of this build to. + Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value + will be used to look up a Docker image repository to push to. In the + case of an ImageStreamTag, the ImageStreamTag will be looked for in + the namespace of the build unless Namespace is specified. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + post_commit: + description: + - postCommit is a build hook executed after the build output image is committed, + before it is pushed to a registry. + type: complex + contains: + args: + description: + - args is a list of arguments that are provided to either Command, Script + or the Docker image's default entrypoint. The arguments are placed + immediately after the command to be run. + type: list + contains: str + command: + description: + - command is the command to run. It may not be specified with Script. + This might be needed if the image doesn't have `/bin/sh`, or if you + do not want to use a shell. In all other cases, using Script might + be more convenient. + type: list + contains: str + script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may not + be specified with Command. Use Script when a shell script is appropriate + to execute the post build hook, for example for running unit tests + with `rake test`. If you need control over the image entrypoint, or + if the image does not have `/bin/sh`, use Command and/or Args. The + `-i` flag is needed to support CentOS and RHEL images that use Software + Collections (SCL), in order to have the appropriate collections enabled + in the shell. E.g., in the Ruby image, this is necessary to make `ruby`, + `bundle` and other binaries available in the PATH. + type: str + resources: + description: + - resources computes resource requirements to execute the build. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that + is explicitly specified, otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + revision: + description: + - revision is the information from the source for a specific repo snapshot. + This is optional. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', + or 'Images' + type: str + service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the pod + created by this build. The pod will be allowed to use secrets referenced + by the ServiceAccount + type: str + source: + description: + - source describes the SCM in use. + type: complex + contains: + binary: + description: + - binary builds accept a binary as their input. The binary is generally + assumed to be a tar, gzipped tar, or zip file depending on the strategy. + For Docker builds, this is the build context and an optional Dockerfile + may be specified to override any Dockerfile in the build context. + For Source builds, this is assumed to be an archive as described above. + For Source and Docker builds, if binary.asFile is set the build will + receive a directory with a single file. contextDir may be used when + an archive is provided. Custom builds will receive this binary as + input on STDIN. + type: complex + contains: + as_file: + description: + - asFile indicates that the provided binary input should be considered + a single file within the build input. For example, specifying + "webapp.war" would place the provided binary as `/webapp.war` + for the builder. If left empty, the Docker and Source build strategies + assume this file is a zip, tar, or tar.gz file and extract it + as the source. The custom strategy receives this binary as standard + input. This filename may not contain slashes or be '..' or '.'. + type: str + context_dir: + description: + - contextDir specifies the sub-directory where the source code for the + application exists. This allows to have buildable sources in directory + other than root of repository. + type: str + dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be built. + When this option is specified, the FROM may be modified based on your + strategy base image and additional ENV stanzas from your strategy + environment will be added after the FROM, but before the rest of your + Dockerfile stanzas. The Dockerfile source type may be used with other + options like git - in those cases the Git repo will have any innate + Dockerfile replaced in the context dir. + type: str + git: + description: + - git contains optional information about git build source + type: complex + contains: + http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over http + type: str + https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over https + type: str + no_proxy: + description: + - noProxy is the list of domains for which the proxy should not + be used + type: str + ref: + description: + - ref is the branch/tag/ref to build. + type: str + uri: + description: + - uri points to the source that will be built. The structure of + the source will depend on the type of build to run + type: str + images: + description: + - images describes a set of images to be used to provide source for + the build + type: list + contains: + _from: + description: + - from is a reference to an ImageStreamTag, ImageStreamImage, or + DockerImage to copy source from. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + paths: + description: + - paths is a list of source and destination paths to copy from the + image. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory inside + the image to copy to the build directory. + type: str + pull_secret: + description: + - pullSecret is a reference to a secret to be used to pull the image + from a registry If the image is pulled from the OpenShift registry, + this field does not need to be set. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets represents a list of secrets and their destinations that will + be used only for the build. + type: list + contains: + destination_dir: + description: + - destinationDir is the directory where the files from the secret + should be available for the build time. For the Source build strategy, + these will be injected into a container where the assemble script + runs. Later, when the script finishes, all files injected will + be truncated to zero length. For the Docker build strategy, these + will be copied into the build directory, where the Dockerfile + is located, so users can ADD or COPY them during docker build. + type: str + secret: + description: + - secret is a reference to an existing secret that you want to use + in your build. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + source_secret: + description: + - "sourceSecret is the name of a Secret that would be used for setting\ + \ up the authentication for cloning private repository. The secret\ + \ contains valid credentials for remote repository, where the data's\ + \ key represent the authentication method to be used and value is\ + \ the base64 encoded credentials. Supported auth methods are: ssh-privatekey." + type: complex + contains: + name: + description: + - Name of the referent. + type: str + type: + description: + - type of build input to accept + type: str + strategy: + description: + - strategy defines how to perform a build. + type: complex + contains: + custom_strategy: + description: + - customStrategy holds the parameters to the Custom build strategy + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + build_api_version: + description: + - buildAPIVersion is the requested API version for the Build object + serialized and passed to the custom builder + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and build + Docker images) from inside the Docker container. + type: bool + force_pull: + description: + - forcePull describes if the controller should configure the build + pod to always pull the images for the builder or only pull if + it is not present locally + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets is a list of additional secrets that will be included + in the build pod + type: list + contains: + mount_path: + description: + - mountPath is the path at which to mount the secret + type: str + secret_source: + description: + - secretSource is a reference to the secret + type: complex + contains: + name: + description: + - Name of the referent. + type: str + docker_strategy: + description: + - dockerStrategy holds the parameters to the Docker build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled the resulting image + will be used in the FROM line of the Dockerfile for this build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be used + to build the Docker image, relative to the root of the context + (contextDir). + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images from + registry prior to building. + type: bool + no_cache: + description: + - noCache if set to true indicates that the docker build must be + executed with the --no-cache=true flag + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + jenkins_pipeline_strategy: + description: + - JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline + build strategy. This strategy is in tech preview. + type: complex + contains: + jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile + which defines a Jenkins pipeline build. + type: str + jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that will + be used to configure the pipeline relative to the root of the + context (contextDir). If both JenkinsfilePath & Jenkinsfile are + both not specified, this defaults to Jenkinsfile in the root of + the specified contextDir. + type: str + source_strategy: + description: + - sourceStrategy holds the parameters to the Source build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images from + registry prior to building. + type: bool + incremental: + description: + - incremental flag forces the Source build to do incremental builds + if true. + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs + that will be copied from the builder to the runtime image. sourcePath + can be a file or directory. destinationDir must be a directory. + destinationDir can also be empty or equal to ".", in this case + it just refers to the root of WORKDIR. This field and the feature + it enables are in tech preview. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory inside + the image to copy to the build directory. + type: str + runtime_image: + description: + - runtimeImage is an optional image that is used to run an application + without unneeded dependencies installed. The building of the application + is still done in the builder image but, post build, you can copy + the needed artifacts in the runtime image for use. This field + and the feature it enables are in tech preview. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + scripts: + description: + - scripts is the location of Source scripts + type: str + type: + description: + - type is the kind of build strategy. + type: str + triggered_by: + description: + - triggeredBy describes which triggers started the most recent update to + the build configuration and contains information about those triggers. + type: list + contains: + generic_web_hook: + description: + - genericWebHook holds data about a builds generic webhook trigger. + type: complex + contains: + revision: + description: + - revision is an optional field that stores the git source revision + information of the generic webhook trigger when it is available. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + github_web_hook: + description: + - gitHubWebHook represents data for a GitHub webhook that fired a specific + build. + type: complex + contains: + revision: + description: + - revision is the git revision information of the trigger. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + image_change_build: + description: + - imageChangeBuild stores information about an imagechange event that + triggered a new build. + type: complex + contains: + from_ref: + description: + - fromRef contains detailed information about an image that triggered + a build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + image_id: + description: + - imageID is the ID of the image that triggered a a new build. + type: str + message: + description: + - 'message is used to store a human readable message for why the build + was triggered. E.g.: "Manually triggered by user", "Configuration + change",etc.' + type: str + status: + description: + - status is the current status of the build. + type: complex + contains: + cancelled: + description: + - cancelled describes if a cancel event was triggered for the build. + type: bool + completion_timestamp: + description: + - completionTimestamp is a timestamp representing the server time when this + Build was finished, whether that build failed or succeeded. It reflects + the time at which the Pod running the Build terminated. It is represented + in RFC3339 form and is in UTC. + type: complex + contains: {} + config: + description: + - config is an ObjectReference to the BuildConfig this Build is based on. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + duration: + description: + - duration contains time.Duration object describing build time. + type: int + message: + description: + - message is a human-readable message indicating details about why the build + has this status. + type: str + output: + description: + - output describes the Docker image the build has produced. + type: complex + contains: + to: + description: + - to describes the status of the built image being pushed to a registry. + type: complex + contains: + image_digest: + description: + - imageDigest is the digest of the built Docker image. The digest + uniquely identifies the image in the registry to which it was + pushed. Please note that this field may not always be set even + if the push completes successfully - e.g. when the registry returns + no digest or returns it in a format that the builder doesn't understand. + type: str + output_docker_image_reference: + description: + - outputDockerImageReference contains a reference to the Docker image that + will be built by this build. Its value is computed from Build.Spec.Output.To, + and should include the registry address, so that it can be used to push + and pull the image. + type: str + phase: + description: + - phase is the point in the build lifecycle. + type: str + reason: + description: + - reason is a brief CamelCase string that describes any failure and is meant + for machine parsing and tidy display in the CLI. + type: str + start_timestamp: + description: + - startTimestamp is a timestamp representing the server time when this Build + started running in a Pod. It is represented in RFC3339 form and is in + UTC. + type: complex + contains: {} +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('build', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_build_config.py b/library/k8s_v1_build_config.py new file mode 100644 index 00000000..d1128e08 --- /dev/null +++ b/library/k8s_v1_build_config.py @@ -0,0 +1,1947 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_build_config +short_description: Kubernetes BuildConfig +description: +- Manage the lifecycle of a build_config object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted from the + time when a build pod gets scheduled in the system, that the build may be active + on a node before the system actively tries to terminate the build; value must + be positive integer + aliases: + - completion_deadline_seconds + type: int + spec_node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to fit on a + node If nil, it can be overridden by default build nodeselector values for the + cluster. If set to an empty map or a map with any values, default build nodeselector + values are ignored. + aliases: + - node_selector + type: dict + spec_output_image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting image. + If there are multiple labels with the same name then the last one in the list + is used. + aliases: + - output_image_labels + type: list + spec_output_push_secret_name: + description: + - Name of the referent. + aliases: + - output_push_secret_name + spec_output_to_api_version: + description: + - API version of the referent. + aliases: + - output_to_api_version + spec_output_to_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - output_to_field_path + spec_output_to_kind: + description: + - Kind of the referent. + aliases: + - output_to_kind + spec_output_to_name: + description: + - Name of the referent. + aliases: + - output_to_name + spec_output_to_namespace: + description: + - Namespace of the referent. + aliases: + - output_to_namespace + spec_output_to_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - output_to_resource_version + spec_output_to_uid: + description: + - UID of the referent. + aliases: + - output_to_uid + spec_post_commit_args: + description: + - args is a list of arguments that are provided to either Command, Script or the + Docker image's default entrypoint. The arguments are placed immediately after + the command to be run. + aliases: + - post_commit_args + type: list + spec_post_commit_command: + description: + - command is the command to run. It may not be specified with Script. This might + be needed if the image doesn't have `/bin/sh`, or if you do not want to use + a shell. In all other cases, using Script might be more convenient. + aliases: + - post_commit_command + type: list + spec_post_commit_script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may not be specified + with Command. Use Script when a shell script is appropriate to execute the post + build hook, for example for running unit tests with `rake test`. If you need + control over the image entrypoint, or if the image does not have `/bin/sh`, + use Command and/or Args. The `-i` flag is needed to support CentOS and RHEL + images that use Software Collections (SCL), in order to have the appropriate + collections enabled in the shell. E.g., in the Ruby image, this is necessary + to make `ruby`, `bundle` and other binaries available in the PATH. + aliases: + - post_commit_script + spec_resources_limits: + description: + - Limits describes the maximum amount of compute resources allowed. + aliases: + - resources_limits + type: dict + spec_resources_requests: + description: + - Requests describes the minimum amount of compute resources required. If Requests + is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + aliases: + - resources_requests + type: dict + spec_revision_git_author_email: + description: + - email of the source control user + aliases: + - revision_git_author_email + spec_revision_git_author_name: + description: + - name of the source control user + aliases: + - revision_git_author_name + spec_revision_git_commit: + description: + - commit is the commit hash identifying a specific commit + aliases: + - revision_git_commit + spec_revision_git_committer_email: + description: + - email of the source control user + aliases: + - revision_git_committer_email + spec_revision_git_committer_name: + description: + - name of the source control user + aliases: + - revision_git_committer_name + spec_revision_git_message: + description: + - message is the description of a specific commit + aliases: + - revision_git_message + spec_revision_type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or + 'Images' + aliases: + - revision_type + spec_run_policy: + description: + - RunPolicy describes how the new build created from this build configuration + will be scheduled for execution. This is optional, if not specified we default + to "Serial". + aliases: + - run_policy + spec_service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the pod created + by this build. The pod will be allowed to use secrets referenced by the ServiceAccount + aliases: + - service_account + spec_source_binary_as_file: + description: + - asFile indicates that the provided binary input should be considered a single + file within the build input. For example, specifying "webapp.war" would place + the provided binary as `/webapp.war` for the builder. If left empty, the Docker + and Source build strategies assume this file is a zip, tar, or tar.gz file and + extract it as the source. The custom strategy receives this binary as standard + input. This filename may not contain slashes or be '..' or '.'. + aliases: + - source_binary_as_file + spec_source_context_dir: + description: + - contextDir specifies the sub-directory where the source code for the application + exists. This allows to have buildable sources in directory other than root of + repository. + aliases: + - source_context_dir + spec_source_dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be built. When this + option is specified, the FROM may be modified based on your strategy base image + and additional ENV stanzas from your strategy environment will be added after + the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source + type may be used with other options like git - in those cases the Git repo will + have any innate Dockerfile replaced in the context dir. + aliases: + - source_dockerfile + spec_source_git_http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over http + aliases: + - source_git_http_proxy + spec_source_git_https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over https + aliases: + - source_git_https_proxy + spec_source_git_no_proxy: + description: + - noProxy is the list of domains for which the proxy should not be used + aliases: + - source_git_no_proxy + spec_source_git_ref: + description: + - ref is the branch/tag/ref to build. + aliases: + - source_git_ref + spec_source_git_uri: + description: + - uri points to the source that will be built. The structure of the source will + depend on the type of build to run + aliases: + - source_git_uri + spec_source_images: + description: + - images describes a set of images to be used to provide source for the build + aliases: + - source_images + type: list + spec_source_secrets: + description: + - secrets represents a list of secrets and their destinations that will be used + only for the build. + aliases: + - source_secrets + type: list + spec_source_source_secret_name: + description: + - Name of the referent. + aliases: + - source_secret_name + spec_source_type: + description: + - type of build input to accept + aliases: + - source_type + spec_strategy_custom_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_custom_strategy__from_api_version + spec_strategy_custom_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_custom_strategy__from_field_path + spec_strategy_custom_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_custom_strategy__from_kind + spec_strategy_custom_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_custom_strategy__from_name + spec_strategy_custom_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_custom_strategy__from_namespace + spec_strategy_custom_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_custom_strategy__from_resource_version + spec_strategy_custom_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_custom_strategy__from_uid + spec_strategy_custom_strategy_build_api_version: + description: + - buildAPIVersion is the requested API version for the Build object serialized + and passed to the custom builder + aliases: + - strategy_custom_strategy_build_api_version + spec_strategy_custom_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_custom_strategy_env + type: list + spec_strategy_custom_strategy_expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and build Docker images) + from inside the Docker container. + aliases: + - strategy_custom_strategy_expose_docker_socket + type: bool + spec_strategy_custom_strategy_force_pull: + description: + - forcePull describes if the controller should configure the build pod to always + pull the images for the builder or only pull if it is not present locally + aliases: + - strategy_custom_strategy_force_pull + type: bool + spec_strategy_custom_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_custom_strategy_pull_secret_name + spec_strategy_custom_strategy_secrets: + description: + - secrets is a list of additional secrets that will be included in the build pod + aliases: + - strategy_custom_strategy_secrets + type: list + spec_strategy_docker_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_docker_strategy__from_api_version + spec_strategy_docker_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_docker_strategy__from_field_path + spec_strategy_docker_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_docker_strategy__from_kind + spec_strategy_docker_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_docker_strategy__from_name + spec_strategy_docker_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_docker_strategy__from_namespace + spec_strategy_docker_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_docker_strategy__from_resource_version + spec_strategy_docker_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_docker_strategy__from_uid + spec_strategy_docker_strategy_dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be used to build the + Docker image, relative to the root of the context (contextDir). + aliases: + - strategy_docker_strategy_dockerfile_path + spec_strategy_docker_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_docker_strategy_env + type: list + spec_strategy_docker_strategy_force_pull: + description: + - forcePull describes if the builder should pull the images from registry prior + to building. + aliases: + - strategy_docker_strategy_force_pull + type: bool + spec_strategy_docker_strategy_no_cache: + description: + - noCache if set to true indicates that the docker build must be executed with + the --no-cache=true flag + aliases: + - strategy_docker_strategy_no_cache + type: bool + spec_strategy_docker_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_docker_strategy_pull_secret_name + spec_strategy_jenkins_pipeline_strategy_jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines + a Jenkins pipeline build. + aliases: + - strategy_jenkins_pipeline_strategy_jenkinsfile + spec_strategy_jenkins_pipeline_strategy_jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that will be used to + configure the pipeline relative to the root of the context (contextDir). If + both JenkinsfilePath & Jenkinsfile are both not specified, this defaults to + Jenkinsfile in the root of the specified contextDir. + aliases: + - strategy_jenkins_pipeline_strategy_jenkinsfile_path + spec_strategy_source_strategy__from_api_version: + description: + - API version of the referent. + aliases: + - strategy_source_strategy__from_api_version + spec_strategy_source_strategy__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_source_strategy__from_field_path + spec_strategy_source_strategy__from_kind: + description: + - Kind of the referent. + aliases: + - strategy_source_strategy__from_kind + spec_strategy_source_strategy__from_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy__from_name + spec_strategy_source_strategy__from_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_source_strategy__from_namespace + spec_strategy_source_strategy__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_source_strategy__from_resource_version + spec_strategy_source_strategy__from_uid: + description: + - UID of the referent. + aliases: + - strategy_source_strategy__from_uid + spec_strategy_source_strategy_env: + description: + - env contains additional environment variables you want to pass into a builder + container + aliases: + - strategy_source_strategy_env + type: list + spec_strategy_source_strategy_force_pull: + description: + - forcePull describes if the builder should pull the images from registry prior + to building. + aliases: + - strategy_source_strategy_force_pull + type: bool + spec_strategy_source_strategy_incremental: + description: + - incremental flag forces the Source build to do incremental builds if true. + aliases: + - strategy_source_strategy_incremental + type: bool + spec_strategy_source_strategy_pull_secret_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy_pull_secret_name + spec_strategy_source_strategy_runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs that will be copied + from the builder to the runtime image. sourcePath can be a file or directory. + destinationDir must be a directory. destinationDir can also be empty or equal + to ".", in this case it just refers to the root of WORKDIR. This field and the + feature it enables are in tech preview. + aliases: + - strategy_source_strategy_runtime_artifacts + type: list + spec_strategy_source_strategy_runtime_image_api_version: + description: + - API version of the referent. + aliases: + - strategy_source_strategy_runtime_image_api_version + spec_strategy_source_strategy_runtime_image_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - strategy_source_strategy_runtime_image_field_path + spec_strategy_source_strategy_runtime_image_kind: + description: + - Kind of the referent. + aliases: + - strategy_source_strategy_runtime_image_kind + spec_strategy_source_strategy_runtime_image_name: + description: + - Name of the referent. + aliases: + - strategy_source_strategy_runtime_image_name + spec_strategy_source_strategy_runtime_image_namespace: + description: + - Namespace of the referent. + aliases: + - strategy_source_strategy_runtime_image_namespace + spec_strategy_source_strategy_runtime_image_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - strategy_source_strategy_runtime_image_resource_version + spec_strategy_source_strategy_runtime_image_uid: + description: + - UID of the referent. + aliases: + - strategy_source_strategy_runtime_image_uid + spec_strategy_source_strategy_scripts: + description: + - scripts is the location of Source scripts + aliases: + - strategy_source_strategy_scripts + spec_strategy_type: + description: + - type is the kind of build strategy. + aliases: + - strategy_type + spec_triggers: + description: + - triggers determine how new Builds can be launched from a BuildConfig. If no + triggers are defined, a new build can only occur as a result of an explicit + client build creation. + aliases: + - triggers + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +build_config: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - metadata for BuildConfig. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - spec holds all the input necessary to produce a new build, and the conditions + when to trigger them. + type: complex + contains: + completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted + from the time when a build pod gets scheduled in the system, that the + build may be active on a node before the system actively tries to terminate + the build; value must be positive integer + type: int + node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to fit + on a node If nil, it can be overridden by default build nodeselector values + for the cluster. If set to an empty map or a map with any values, default + build nodeselector values are ignored. + type: complex + contains: str, str + output: + description: + - output describes the Docker image the Strategy should produce. + type: complex + contains: + image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting + image. If there are multiple labels with the same name then the last + one in the list is used. + type: list + contains: + name: + description: + - name defines the name of the label. It must have non-zero length. + type: str + value: + description: + - value defines the literal value of the label. + type: str + push_secret: + description: + - PushSecret is the name of a Secret that would be used for setting + up the authentication for executing the Docker push to authentication + enabled Docker Registry (or Docker Hub). + type: complex + contains: + name: + description: + - Name of the referent. + type: str + to: + description: + - to defines an optional location to push the output of this build to. + Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value + will be used to look up a Docker image repository to push to. In the + case of an ImageStreamTag, the ImageStreamTag will be looked for in + the namespace of the build unless Namespace is specified. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + post_commit: + description: + - postCommit is a build hook executed after the build output image is committed, + before it is pushed to a registry. + type: complex + contains: + args: + description: + - args is a list of arguments that are provided to either Command, Script + or the Docker image's default entrypoint. The arguments are placed + immediately after the command to be run. + type: list + contains: str + command: + description: + - command is the command to run. It may not be specified with Script. + This might be needed if the image doesn't have `/bin/sh`, or if you + do not want to use a shell. In all other cases, using Script might + be more convenient. + type: list + contains: str + script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may not + be specified with Command. Use Script when a shell script is appropriate + to execute the post build hook, for example for running unit tests + with `rake test`. If you need control over the image entrypoint, or + if the image does not have `/bin/sh`, use Command and/or Args. The + `-i` flag is needed to support CentOS and RHEL images that use Software + Collections (SCL), in order to have the appropriate collections enabled + in the shell. E.g., in the Ruby image, this is necessary to make `ruby`, + `bundle` and other binaries available in the PATH. + type: str + resources: + description: + - resources computes resource requirements to execute the build. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that + is explicitly specified, otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + revision: + description: + - revision is the information from the source for a specific repo snapshot. + This is optional. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', + or 'Images' + type: str + run_policy: + description: + - RunPolicy describes how the new build created from this build configuration + will be scheduled for execution. This is optional, if not specified we + default to "Serial". + type: str + service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the pod + created by this build. The pod will be allowed to use secrets referenced + by the ServiceAccount + type: str + source: + description: + - source describes the SCM in use. + type: complex + contains: + binary: + description: + - binary builds accept a binary as their input. The binary is generally + assumed to be a tar, gzipped tar, or zip file depending on the strategy. + For Docker builds, this is the build context and an optional Dockerfile + may be specified to override any Dockerfile in the build context. + For Source builds, this is assumed to be an archive as described above. + For Source and Docker builds, if binary.asFile is set the build will + receive a directory with a single file. contextDir may be used when + an archive is provided. Custom builds will receive this binary as + input on STDIN. + type: complex + contains: + as_file: + description: + - asFile indicates that the provided binary input should be considered + a single file within the build input. For example, specifying + "webapp.war" would place the provided binary as `/webapp.war` + for the builder. If left empty, the Docker and Source build strategies + assume this file is a zip, tar, or tar.gz file and extract it + as the source. The custom strategy receives this binary as standard + input. This filename may not contain slashes or be '..' or '.'. + type: str + context_dir: + description: + - contextDir specifies the sub-directory where the source code for the + application exists. This allows to have buildable sources in directory + other than root of repository. + type: str + dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be built. + When this option is specified, the FROM may be modified based on your + strategy base image and additional ENV stanzas from your strategy + environment will be added after the FROM, but before the rest of your + Dockerfile stanzas. The Dockerfile source type may be used with other + options like git - in those cases the Git repo will have any innate + Dockerfile replaced in the context dir. + type: str + git: + description: + - git contains optional information about git build source + type: complex + contains: + http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over http + type: str + https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over https + type: str + no_proxy: + description: + - noProxy is the list of domains for which the proxy should not + be used + type: str + ref: + description: + - ref is the branch/tag/ref to build. + type: str + uri: + description: + - uri points to the source that will be built. The structure of + the source will depend on the type of build to run + type: str + images: + description: + - images describes a set of images to be used to provide source for + the build + type: list + contains: + _from: + description: + - from is a reference to an ImageStreamTag, ImageStreamImage, or + DockerImage to copy source from. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + paths: + description: + - paths is a list of source and destination paths to copy from the + image. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory inside + the image to copy to the build directory. + type: str + pull_secret: + description: + - pullSecret is a reference to a secret to be used to pull the image + from a registry If the image is pulled from the OpenShift registry, + this field does not need to be set. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets represents a list of secrets and their destinations that will + be used only for the build. + type: list + contains: + destination_dir: + description: + - destinationDir is the directory where the files from the secret + should be available for the build time. For the Source build strategy, + these will be injected into a container where the assemble script + runs. Later, when the script finishes, all files injected will + be truncated to zero length. For the Docker build strategy, these + will be copied into the build directory, where the Dockerfile + is located, so users can ADD or COPY them during docker build. + type: str + secret: + description: + - secret is a reference to an existing secret that you want to use + in your build. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + source_secret: + description: + - "sourceSecret is the name of a Secret that would be used for setting\ + \ up the authentication for cloning private repository. The secret\ + \ contains valid credentials for remote repository, where the data's\ + \ key represent the authentication method to be used and value is\ + \ the base64 encoded credentials. Supported auth methods are: ssh-privatekey." + type: complex + contains: + name: + description: + - Name of the referent. + type: str + type: + description: + - type of build input to accept + type: str + strategy: + description: + - strategy defines how to perform a build. + type: complex + contains: + custom_strategy: + description: + - customStrategy holds the parameters to the Custom build strategy + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + build_api_version: + description: + - buildAPIVersion is the requested API version for the Build object + serialized and passed to the custom builder + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and build + Docker images) from inside the Docker container. + type: bool + force_pull: + description: + - forcePull describes if the controller should configure the build + pod to always pull the images for the builder or only pull if + it is not present locally + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets is a list of additional secrets that will be included + in the build pod + type: list + contains: + mount_path: + description: + - mountPath is the path at which to mount the secret + type: str + secret_source: + description: + - secretSource is a reference to the secret + type: complex + contains: + name: + description: + - Name of the referent. + type: str + docker_strategy: + description: + - dockerStrategy holds the parameters to the Docker build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled the resulting image + will be used in the FROM line of the Dockerfile for this build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be used + to build the Docker image, relative to the root of the context + (contextDir). + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images from + registry prior to building. + type: bool + no_cache: + description: + - noCache if set to true indicates that the docker build must be + executed with the --no-cache=true flag + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + jenkins_pipeline_strategy: + description: + - JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline + build strategy. This strategy is in tech preview. + type: complex + contains: + jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile + which defines a Jenkins pipeline build. + type: str + jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that will + be used to configure the pipeline relative to the root of the + context (contextDir). If both JenkinsfilePath & Jenkinsfile are + both not specified, this defaults to Jenkinsfile in the root of + the specified contextDir. + type: str + source_strategy: + description: + - sourceStrategy holds the parameters to the Source build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + env: + description: + - env contains additional environment variables you want to pass + into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images from + registry prior to building. + type: bool + incremental: + description: + - incremental flag forces the Source build to do incremental builds + if true. + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for setting + up the authentication for pulling the Docker images from the private + Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs + that will be copied from the builder to the runtime image. sourcePath + can be a file or directory. destinationDir must be a directory. + destinationDir can also be empty or equal to ".", in this case + it just refers to the root of WORKDIR. This field and the feature + it enables are in tech preview. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory inside + the image to copy to the build directory. + type: str + runtime_image: + description: + - runtimeImage is an optional image that is used to run an application + without unneeded dependencies installed. The building of the application + is still done in the builder image but, post build, you can copy + the needed artifacts in the runtime image for use. This field + and the feature it enables are in tech preview. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + scripts: + description: + - scripts is the location of Source scripts + type: str + type: + description: + - type is the kind of build strategy. + type: str + triggers: + description: + - triggers determine how new Builds can be launched from a BuildConfig. + If no triggers are defined, a new build can only occur as a result of + an explicit client build creation. + type: list + contains: + generic: + description: + - generic contains the parameters for a Generic webhook type of trigger + type: complex + contains: + allow_env: + description: + - allowEnv determines whether the webhook can set environment variables; + can only be set to true for GenericWebHook. + type: bool + secret: + description: + - secret used to validate requests. + type: str + github: + description: + - github contains the parameters for a GitHub webhook type of trigger + type: complex + contains: + allow_env: + description: + - allowEnv determines whether the webhook can set environment variables; + can only be set to true for GenericWebHook. + type: bool + secret: + description: + - secret used to validate requests. + type: str + image_change: + description: + - imageChange contains parameters for an ImageChange type of trigger + type: complex + contains: + _from: + description: + - from is a reference to an ImageStreamTag that will trigger a build + when updated It is optional. If no From is specified, the From + image from the build strategy will be used. Only one ImageChangeTrigger + with an empty From reference is allowed in a build configuration. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + last_triggered_image_id: + description: + - lastTriggeredImageID is used internally by the ImageChangeController + to save last used image ID for build + type: str + type: + description: + - type is the type of build trigger + type: str + status: + description: + - status holds any relevant information about a build config + type: complex + contains: + last_version: + description: + - lastVersion is used to inform about number of last triggered build. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('build_config', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_build_config_list.py b/library/k8s_v1_build_config_list.py new file mode 100644 index 00000000..3f7f569b --- /dev/null +++ b/library/k8s_v1_build_config_list.py @@ -0,0 +1,1448 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_build_config_list +short_description: Kubernetes BuildConfigList +description: +- Retrieve a list of build_configs. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +build_config_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - items is a list of build configs + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - metadata for BuildConfig. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - spec holds all the input necessary to produce a new build, and the conditions + when to trigger them. + type: complex + contains: + completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted + from the time when a build pod gets scheduled in the system, that + the build may be active on a node before the system actively tries + to terminate the build; value must be positive integer + type: int + node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to + fit on a node If nil, it can be overridden by default build nodeselector + values for the cluster. If set to an empty map or a map with any values, + default build nodeselector values are ignored. + type: complex + contains: str, str + output: + description: + - output describes the Docker image the Strategy should produce. + type: complex + contains: + image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting + image. If there are multiple labels with the same name then the + last one in the list is used. + type: list + contains: + name: + description: + - name defines the name of the label. It must have non-zero + length. + type: str + value: + description: + - value defines the literal value of the label. + type: str + push_secret: + description: + - PushSecret is the name of a Secret that would be used for setting + up the authentication for executing the Docker push to authentication + enabled Docker Registry (or Docker Hub). + type: complex + contains: + name: + description: + - Name of the referent. + type: str + to: + description: + - to defines an optional location to push the output of this build + to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This + value will be used to look up a Docker image repository to push + to. In the case of an ImageStreamTag, the ImageStreamTag will + be looked for in the namespace of the build unless Namespace is + specified. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + post_commit: + description: + - postCommit is a build hook executed after the build output image is + committed, before it is pushed to a registry. + type: complex + contains: + args: + description: + - args is a list of arguments that are provided to either Command, + Script or the Docker image's default entrypoint. The arguments + are placed immediately after the command to be run. + type: list + contains: str + command: + description: + - command is the command to run. It may not be specified with Script. + This might be needed if the image doesn't have `/bin/sh`, or if + you do not want to use a shell. In all other cases, using Script + might be more convenient. + type: list + contains: str + script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may + not be specified with Command. Use Script when a shell script + is appropriate to execute the post build hook, for example for + running unit tests with `rake test`. If you need control over + the image entrypoint, or if the image does not have `/bin/sh`, + use Command and/or Args. The `-i` flag is needed to support CentOS + and RHEL images that use Software Collections (SCL), in order + to have the appropriate collections enabled in the shell. E.g., + in the Ruby image, this is necessary to make `ruby`, `bundle` + and other binaries available in the PATH. + type: str + resources: + description: + - resources computes resource requirements to execute the build. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + revision: + description: + - revision is the information from the source for a specific repo snapshot. + This is optional. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + run_policy: + description: + - RunPolicy describes how the new build created from this build configuration + will be scheduled for execution. This is optional, if not specified + we default to "Serial". + type: str + service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the + pod created by this build. The pod will be allowed to use secrets + referenced by the ServiceAccount + type: str + source: + description: + - source describes the SCM in use. + type: complex + contains: + binary: + description: + - binary builds accept a binary as their input. The binary is generally + assumed to be a tar, gzipped tar, or zip file depending on the + strategy. For Docker builds, this is the build context and an + optional Dockerfile may be specified to override any Dockerfile + in the build context. For Source builds, this is assumed to be + an archive as described above. For Source and Docker builds, if + binary.asFile is set the build will receive a directory with a + single file. contextDir may be used when an archive is provided. + Custom builds will receive this binary as input on STDIN. + type: complex + contains: + as_file: + description: + - asFile indicates that the provided binary input should be + considered a single file within the build input. For example, + specifying "webapp.war" would place the provided binary as + `/webapp.war` for the builder. If left empty, the Docker and + Source build strategies assume this file is a zip, tar, or + tar.gz file and extract it as the source. The custom strategy + receives this binary as standard input. This filename may + not contain slashes or be '..' or '.'. + type: str + context_dir: + description: + - contextDir specifies the sub-directory where the source code for + the application exists. This allows to have buildable sources + in directory other than root of repository. + type: str + dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be + built. When this option is specified, the FROM may be modified + based on your strategy base image and additional ENV stanzas from + your strategy environment will be added after the FROM, but before + the rest of your Dockerfile stanzas. The Dockerfile source type + may be used with other options like git - in those cases the Git + repo will have any innate Dockerfile replaced in the context dir. + type: str + git: + description: + - git contains optional information about git build source + type: complex + contains: + http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over + http + type: str + https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over + https + type: str + no_proxy: + description: + - noProxy is the list of domains for which the proxy should + not be used + type: str + ref: + description: + - ref is the branch/tag/ref to build. + type: str + uri: + description: + - uri points to the source that will be built. The structure + of the source will depend on the type of build to run + type: str + images: + description: + - images describes a set of images to be used to provide source + for the build + type: list + contains: + _from: + description: + - from is a reference to an ImageStreamTag, ImageStreamImage, + or DockerImage to copy source from. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + paths: + description: + - paths is a list of source and destination paths to copy from + the image. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory + inside the image to copy to the build directory. + type: str + pull_secret: + description: + - pullSecret is a reference to a secret to be used to pull the + image from a registry If the image is pulled from the OpenShift + registry, this field does not need to be set. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets represents a list of secrets and their destinations that + will be used only for the build. + type: list + contains: + destination_dir: + description: + - destinationDir is the directory where the files from the secret + should be available for the build time. For the Source build + strategy, these will be injected into a container where the + assemble script runs. Later, when the script finishes, all + files injected will be truncated to zero length. For the Docker + build strategy, these will be copied into the build directory, + where the Dockerfile is located, so users can ADD or COPY + them during docker build. + type: str + secret: + description: + - secret is a reference to an existing secret that you want + to use in your build. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + source_secret: + description: + - "sourceSecret is the name of a Secret that would be used for setting\ + \ up the authentication for cloning private repository. The secret\ + \ contains valid credentials for remote repository, where the\ + \ data's key represent the authentication method to be used and\ + \ value is the base64 encoded credentials. Supported auth methods\ + \ are: ssh-privatekey." + type: complex + contains: + name: + description: + - Name of the referent. + type: str + type: + description: + - type of build input to accept + type: str + strategy: + description: + - strategy defines how to perform a build. + type: complex + contains: + custom_strategy: + description: + - customStrategy holds the parameters to the Custom build strategy + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + build_api_version: + description: + - buildAPIVersion is the requested API version for the Build + object serialized and passed to the custom builder + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and + build Docker images) from inside the Docker container. + type: bool + force_pull: + description: + - forcePull describes if the controller should configure the + build pod to always pull the images for the builder or only + pull if it is not present locally + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets is a list of additional secrets that will be included + in the build pod + type: list + contains: + mount_path: + description: + - mountPath is the path at which to mount the secret + type: str + secret_source: + description: + - secretSource is a reference to the secret + type: complex + contains: + name: + description: + - Name of the referent. + type: str + docker_strategy: + description: + - dockerStrategy holds the parameters to the Docker build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled the resulting + image will be used in the FROM line of the Dockerfile for + this build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be + used to build the Docker image, relative to the root of the + context (contextDir). + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images + from registry prior to building. + type: bool + no_cache: + description: + - noCache if set to true indicates that the docker build must + be executed with the --no-cache=true flag + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + jenkins_pipeline_strategy: + description: + - JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline + build strategy. This strategy is in tech preview. + type: complex + contains: + jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile + which defines a Jenkins pipeline build. + type: str + jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that + will be used to configure the pipeline relative to the root + of the context (contextDir). If both JenkinsfilePath & Jenkinsfile + are both not specified, this defaults to Jenkinsfile in the + root of the specified contextDir. + type: str + source_strategy: + description: + - sourceStrategy holds the parameters to the Source build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images + from registry prior to building. + type: bool + incremental: + description: + - incremental flag forces the Source build to do incremental + builds if true. + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs + that will be copied from the builder to the runtime image. + sourcePath can be a file or directory. destinationDir must + be a directory. destinationDir can also be empty or equal + to ".", in this case it just refers to the root of WORKDIR. + This field and the feature it enables are in tech preview. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory + inside the image to copy to the build directory. + type: str + runtime_image: + description: + - runtimeImage is an optional image that is used to run an application + without unneeded dependencies installed. The building of the + application is still done in the builder image but, post build, + you can copy the needed artifacts in the runtime image for + use. This field and the feature it enables are in tech preview. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + scripts: + description: + - scripts is the location of Source scripts + type: str + type: + description: + - type is the kind of build strategy. + type: str + triggers: + description: + - triggers determine how new Builds can be launched from a BuildConfig. + If no triggers are defined, a new build can only occur as a result + of an explicit client build creation. + type: list + contains: + generic: + description: + - generic contains the parameters for a Generic webhook type of + trigger + type: complex + contains: + allow_env: + description: + - allowEnv determines whether the webhook can set environment + variables; can only be set to true for GenericWebHook. + type: bool + secret: + description: + - secret used to validate requests. + type: str + github: + description: + - github contains the parameters for a GitHub webhook type of trigger + type: complex + contains: + allow_env: + description: + - allowEnv determines whether the webhook can set environment + variables; can only be set to true for GenericWebHook. + type: bool + secret: + description: + - secret used to validate requests. + type: str + image_change: + description: + - imageChange contains parameters for an ImageChange type of trigger + type: complex + contains: + _from: + description: + - from is a reference to an ImageStreamTag that will trigger + a build when updated It is optional. If no From is specified, + the From image from the build strategy will be used. Only + one ImageChangeTrigger with an empty From reference is allowed + in a build configuration. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + last_triggered_image_id: + description: + - lastTriggeredImageID is used internally by the ImageChangeController + to save last used image ID for build + type: str + type: + description: + - type is the type of build trigger + type: str + status: + description: + - status holds any relevant information about a build config + type: complex + contains: + last_version: + description: + - lastVersion is used to inform about number of last triggered build. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - metadata for BuildConfigList. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('build_config_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_build_list.py b/library/k8s_v1_build_list.py new file mode 100644 index 00000000..a440a91a --- /dev/null +++ b/library/k8s_v1_build_list.py @@ -0,0 +1,1629 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_build_list +short_description: Kubernetes BuildList +description: +- Retrieve a list of builds. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +build_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - items is a list of builds + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - spec is all the inputs used to execute the build. + type: complex + contains: + completion_deadline_seconds: + description: + - completionDeadlineSeconds is an optional duration in seconds, counted + from the time when a build pod gets scheduled in the system, that + the build may be active on a node before the system actively tries + to terminate the build; value must be positive integer + type: int + node_selector: + description: + - nodeSelector is a selector which must be true for the build pod to + fit on a node If nil, it can be overridden by default build nodeselector + values for the cluster. If set to an empty map or a map with any values, + default build nodeselector values are ignored. + type: complex + contains: str, str + output: + description: + - output describes the Docker image the Strategy should produce. + type: complex + contains: + image_labels: + description: + - imageLabels define a list of labels that are applied to the resulting + image. If there are multiple labels with the same name then the + last one in the list is used. + type: list + contains: + name: + description: + - name defines the name of the label. It must have non-zero + length. + type: str + value: + description: + - value defines the literal value of the label. + type: str + push_secret: + description: + - PushSecret is the name of a Secret that would be used for setting + up the authentication for executing the Docker push to authentication + enabled Docker Registry (or Docker Hub). + type: complex + contains: + name: + description: + - Name of the referent. + type: str + to: + description: + - to defines an optional location to push the output of this build + to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This + value will be used to look up a Docker image repository to push + to. In the case of an ImageStreamTag, the ImageStreamTag will + be looked for in the namespace of the build unless Namespace is + specified. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + post_commit: + description: + - postCommit is a build hook executed after the build output image is + committed, before it is pushed to a registry. + type: complex + contains: + args: + description: + - args is a list of arguments that are provided to either Command, + Script or the Docker image's default entrypoint. The arguments + are placed immediately after the command to be run. + type: list + contains: str + command: + description: + - command is the command to run. It may not be specified with Script. + This might be needed if the image doesn't have `/bin/sh`, or if + you do not want to use a shell. In all other cases, using Script + might be more convenient. + type: list + contains: str + script: + description: + - script is a shell script to be run with `/bin/sh -ic`. It may + not be specified with Command. Use Script when a shell script + is appropriate to execute the post build hook, for example for + running unit tests with `rake test`. If you need control over + the image entrypoint, or if the image does not have `/bin/sh`, + use Command and/or Args. The `-i` flag is needed to support CentOS + and RHEL images that use Software Collections (SCL), in order + to have the appropriate collections enabled in the shell. E.g., + in the Ruby image, this is necessary to make `ruby`, `bundle` + and other binaries available in the PATH. + type: str + resources: + description: + - resources computes resource requirements to execute the build. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + revision: + description: + - revision is the information from the source for a specific repo snapshot. + This is optional. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + service_account: + description: + - serviceAccount is the name of the ServiceAccount to use to run the + pod created by this build. The pod will be allowed to use secrets + referenced by the ServiceAccount + type: str + source: + description: + - source describes the SCM in use. + type: complex + contains: + binary: + description: + - binary builds accept a binary as their input. The binary is generally + assumed to be a tar, gzipped tar, or zip file depending on the + strategy. For Docker builds, this is the build context and an + optional Dockerfile may be specified to override any Dockerfile + in the build context. For Source builds, this is assumed to be + an archive as described above. For Source and Docker builds, if + binary.asFile is set the build will receive a directory with a + single file. contextDir may be used when an archive is provided. + Custom builds will receive this binary as input on STDIN. + type: complex + contains: + as_file: + description: + - asFile indicates that the provided binary input should be + considered a single file within the build input. For example, + specifying "webapp.war" would place the provided binary as + `/webapp.war` for the builder. If left empty, the Docker and + Source build strategies assume this file is a zip, tar, or + tar.gz file and extract it as the source. The custom strategy + receives this binary as standard input. This filename may + not contain slashes or be '..' or '.'. + type: str + context_dir: + description: + - contextDir specifies the sub-directory where the source code for + the application exists. This allows to have buildable sources + in directory other than root of repository. + type: str + dockerfile: + description: + - dockerfile is the raw contents of a Dockerfile which should be + built. When this option is specified, the FROM may be modified + based on your strategy base image and additional ENV stanzas from + your strategy environment will be added after the FROM, but before + the rest of your Dockerfile stanzas. The Dockerfile source type + may be used with other options like git - in those cases the Git + repo will have any innate Dockerfile replaced in the context dir. + type: str + git: + description: + - git contains optional information about git build source + type: complex + contains: + http_proxy: + description: + - httpProxy is a proxy used to reach the git repository over + http + type: str + https_proxy: + description: + - httpsProxy is a proxy used to reach the git repository over + https + type: str + no_proxy: + description: + - noProxy is the list of domains for which the proxy should + not be used + type: str + ref: + description: + - ref is the branch/tag/ref to build. + type: str + uri: + description: + - uri points to the source that will be built. The structure + of the source will depend on the type of build to run + type: str + images: + description: + - images describes a set of images to be used to provide source + for the build + type: list + contains: + _from: + description: + - from is a reference to an ImageStreamTag, ImageStreamImage, + or DockerImage to copy source from. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + paths: + description: + - paths is a list of source and destination paths to copy from + the image. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory + inside the image to copy to the build directory. + type: str + pull_secret: + description: + - pullSecret is a reference to a secret to be used to pull the + image from a registry If the image is pulled from the OpenShift + registry, this field does not need to be set. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets represents a list of secrets and their destinations that + will be used only for the build. + type: list + contains: + destination_dir: + description: + - destinationDir is the directory where the files from the secret + should be available for the build time. For the Source build + strategy, these will be injected into a container where the + assemble script runs. Later, when the script finishes, all + files injected will be truncated to zero length. For the Docker + build strategy, these will be copied into the build directory, + where the Dockerfile is located, so users can ADD or COPY + them during docker build. + type: str + secret: + description: + - secret is a reference to an existing secret that you want + to use in your build. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + source_secret: + description: + - "sourceSecret is the name of a Secret that would be used for setting\ + \ up the authentication for cloning private repository. The secret\ + \ contains valid credentials for remote repository, where the\ + \ data's key represent the authentication method to be used and\ + \ value is the base64 encoded credentials. Supported auth methods\ + \ are: ssh-privatekey." + type: complex + contains: + name: + description: + - Name of the referent. + type: str + type: + description: + - type of build input to accept + type: str + strategy: + description: + - strategy defines how to perform a build. + type: complex + contains: + custom_strategy: + description: + - customStrategy holds the parameters to the Custom build strategy + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + build_api_version: + description: + - buildAPIVersion is the requested API version for the Build + object serialized and passed to the custom builder + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + expose_docker_socket: + description: + - exposeDockerSocket will allow running Docker commands (and + build Docker images) from inside the Docker container. + type: bool + force_pull: + description: + - forcePull describes if the controller should configure the + build pod to always pull the images for the builder or only + pull if it is not present locally + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + secrets: + description: + - secrets is a list of additional secrets that will be included + in the build pod + type: list + contains: + mount_path: + description: + - mountPath is the path at which to mount the secret + type: str + secret_source: + description: + - secretSource is a reference to the secret + type: complex + contains: + name: + description: + - Name of the referent. + type: str + docker_strategy: + description: + - dockerStrategy holds the parameters to the Docker build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled the resulting + image will be used in the FROM line of the Dockerfile for + this build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + dockerfile_path: + description: + - dockerfilePath is the path of the Dockerfile that will be + used to build the Docker image, relative to the root of the + context (contextDir). + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images + from registry prior to building. + type: bool + no_cache: + description: + - noCache if set to true indicates that the docker build must + be executed with the --no-cache=true flag + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + jenkins_pipeline_strategy: + description: + - JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline + build strategy. This strategy is in tech preview. + type: complex + contains: + jenkinsfile: + description: + - Jenkinsfile defines the optional raw contents of a Jenkinsfile + which defines a Jenkins pipeline build. + type: str + jenkinsfile_path: + description: + - JenkinsfilePath is the optional path of the Jenkinsfile that + will be used to configure the pipeline relative to the root + of the context (contextDir). If both JenkinsfilePath & Jenkinsfile + are both not specified, this defaults to Jenkinsfile in the + root of the specified contextDir. + type: str + source_strategy: + description: + - sourceStrategy holds the parameters to the Source build strategy. + type: complex + contains: + _from: + description: + - from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage + from which the docker image should be pulled + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + env: + description: + - env contains additional environment variables you want to + pass into a builder container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + force_pull: + description: + - forcePull describes if the builder should pull the images + from registry prior to building. + type: bool + incremental: + description: + - incremental flag forces the Source build to do incremental + builds if true. + type: bool + pull_secret: + description: + - pullSecret is the name of a Secret that would be used for + setting up the authentication for pulling the Docker images + from the private Docker registries + type: complex + contains: + name: + description: + - Name of the referent. + type: str + runtime_artifacts: + description: + - runtimeArtifacts specifies a list of source/destination pairs + that will be copied from the builder to the runtime image. + sourcePath can be a file or directory. destinationDir must + be a directory. destinationDir can also be empty or equal + to ".", in this case it just refers to the root of WORKDIR. + This field and the feature it enables are in tech preview. + type: list + contains: + destination_dir: + description: + - destinationDir is the relative directory within the build + directory where files copied from the image are placed. + type: str + source_path: + description: + - sourcePath is the absolute path of the file or directory + inside the image to copy to the build directory. + type: str + runtime_image: + description: + - runtimeImage is an optional image that is used to run an application + without unneeded dependencies installed. The building of the + application is still done in the builder image but, post build, + you can copy the needed artifacts in the runtime image for + use. This field and the feature it enables are in tech preview. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + scripts: + description: + - scripts is the location of Source scripts + type: str + type: + description: + - type is the kind of build strategy. + type: str + triggered_by: + description: + - triggeredBy describes which triggers started the most recent update + to the build configuration and contains information about those triggers. + type: list + contains: + generic_web_hook: + description: + - genericWebHook holds data about a builds generic webhook trigger. + type: complex + contains: + revision: + description: + - revision is an optional field that stores the git source revision + information of the generic webhook trigger when it is available. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + github_web_hook: + description: + - gitHubWebHook represents data for a GitHub webhook that fired + a specific build. + type: complex + contains: + revision: + description: + - revision is the git revision information of the trigger. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + image_change_build: + description: + - imageChangeBuild stores information about an imagechange event + that triggered a new build. + type: complex + contains: + from_ref: + description: + - fromRef contains detailed information about an image that + triggered a build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + image_id: + description: + - imageID is the ID of the image that triggered a a new build. + type: str + message: + description: + - 'message is used to store a human readable message for why the + build was triggered. E.g.: "Manually triggered by user", "Configuration + change",etc.' + type: str + status: + description: + - status is the current status of the build. + type: complex + contains: + cancelled: + description: + - cancelled describes if a cancel event was triggered for the build. + type: bool + completion_timestamp: + description: + - completionTimestamp is a timestamp representing the server time when + this Build was finished, whether that build failed or succeeded. It + reflects the time at which the Pod running the Build terminated. It + is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + config: + description: + - config is an ObjectReference to the BuildConfig this Build is based + on. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + duration: + description: + - duration contains time.Duration object describing build time. + type: int + message: + description: + - message is a human-readable message indicating details about why the + build has this status. + type: str + output: + description: + - output describes the Docker image the build has produced. + type: complex + contains: + to: + description: + - to describes the status of the built image being pushed to a registry. + type: complex + contains: + image_digest: + description: + - imageDigest is the digest of the built Docker image. The digest + uniquely identifies the image in the registry to which it + was pushed. Please note that this field may not always be + set even if the push completes successfully - e.g. when the + registry returns no digest or returns it in a format that + the builder doesn't understand. + type: str + output_docker_image_reference: + description: + - outputDockerImageReference contains a reference to the Docker image + that will be built by this build. Its value is computed from Build.Spec.Output.To, + and should include the registry address, so that it can be used to + push and pull the image. + type: str + phase: + description: + - phase is the point in the build lifecycle. + type: str + reason: + description: + - reason is a brief CamelCase string that describes any failure and + is meant for machine parsing and tidy display in the CLI. + type: str + start_timestamp: + description: + - startTimestamp is a timestamp representing the server time when this + Build started running in a Pod. It is represented in RFC3339 form + and is in UTC. + type: complex + contains: {} + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - metadata for BuildList. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('build_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_build_request.py b/library/k8s_v1_build_request.py new file mode 100644 index 00000000..df7b274e --- /dev/null +++ b/library/k8s_v1_build_request.py @@ -0,0 +1,840 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_build_request +short_description: Kubernetes BuildRequest +description: +- Manage the lifecycle of a build_request object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + _from_api_version: + description: + - API version of the referent. + aliases: + - api_version + _from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + _from_kind: + description: + - Kind of the referent. + aliases: + - kind + _from_name: + description: + - Name of the referent. + aliases: + - name + _from_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + _from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + _from_uid: + description: + - UID of the referent. + aliases: + - uid + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + binary_as_file: + description: + - asFile indicates that the provided binary input should be considered a single + file within the build input. For example, specifying "webapp.war" would place + the provided binary as `/webapp.war` for the builder. If left empty, the Docker + and Source build strategies assume this file is a zip, tar, or tar.gz file and + extract it as the source. The custom strategy receives this binary as standard + input. This filename may not contain slashes or be '..' or '.'. + aliases: + - as_file + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + env: + description: + - env contains additional environment variables you want to pass into a builder + container + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + last_version: + description: + - lastVersion (optional) is the LastVersion of the BuildConfig that was used to + generate the build. If the BuildConfig in the generator doesn't match, a build + will not be generated. + type: int + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + revision_git_author_email: + description: + - email of the source control user + aliases: + - email + revision_git_author_name: + description: + - name of the source control user + aliases: + - name + revision_git_commit: + description: + - commit is the commit hash identifying a specific commit + aliases: + - commit + revision_git_committer_email: + description: + - email of the source control user + aliases: + - email + revision_git_committer_name: + description: + - name of the source control user + aliases: + - name + revision_git_message: + description: + - message is the description of a specific commit + aliases: + - message + revision_type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or + 'Images' + aliases: + - type + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + triggered_by: + description: + - triggeredBy describes which triggers started the most recent update to the build + configuration and contains information about those triggers. + type: list + triggered_by_image_api_version: + description: + - API version of the referent. + aliases: + - api_version + triggered_by_image_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + triggered_by_image_kind: + description: + - Kind of the referent. + aliases: + - kind + triggered_by_image_name: + description: + - Name of the referent. + aliases: + - name + triggered_by_image_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + triggered_by_image_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + triggered_by_image_uid: + description: + - UID of the referent. + aliases: + - uid + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +build_request: + type: complex + returned: on success + contains: + _from: + description: + - from is the reference to the ImageStreamTag that triggered the build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + binary: + description: + - binary indicates a request to build from a binary provided to the builder + type: complex + contains: + as_file: + description: + - asFile indicates that the provided binary input should be considered a + single file within the build input. For example, specifying "webapp.war" + would place the provided binary as `/webapp.war` for the builder. If left + empty, the Docker and Source build strategies assume this file is a zip, + tar, or tar.gz file and extract it as the source. The custom strategy + receives this binary as standard input. This filename may not contain + slashes or be '..' or '.'. + type: str + env: + description: + - env contains additional environment variables you want to pass into a builder + container + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous defined + environment variables in the container and any service environment variables. + If a variable cannot be resolved, the reference in the input string will + be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used if value is + not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, + status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in terms of, defaults + to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, requests.cpu and requests.memory) are + currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, defaults + to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_version: + description: + - lastVersion (optional) is the LastVersion of the BuildConfig that was used + to generate the build. If the BuildConfig in the generator doesn't match, + a build will not be generated. + type: int + metadata: + description: + - metadata for BuildRequest. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + revision: + description: + - revision is the information from the source for a specific repo snapshot. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', + or 'Images' + type: str + triggered_by: + description: + - triggeredBy describes which triggers started the most recent update to the + build configuration and contains information about those triggers. + type: list + contains: + generic_web_hook: + description: + - genericWebHook holds data about a builds generic webhook trigger. + type: complex + contains: + revision: + description: + - revision is an optional field that stores the git source revision + information of the generic webhook trigger when it is available. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + github_web_hook: + description: + - gitHubWebHook represents data for a GitHub webhook that fired a specific + build. + type: complex + contains: + revision: + description: + - revision is the git revision information of the trigger. + type: complex + contains: + git: + description: + - Git contains information about git-based build source + type: complex + contains: + author: + description: + - author is the author of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + commit: + description: + - commit is the commit hash identifying a specific commit + type: str + committer: + description: + - committer is the committer of a specific commit + type: complex + contains: + email: + description: + - email of the source control user + type: str + name: + description: + - name of the source control user + type: str + message: + description: + - message is the description of a specific commit + type: str + type: + description: + - type of the build source, may be one of 'Source', 'Dockerfile', + 'Binary', or 'Images' + type: str + secret: + description: + - secret is the obfuscated webhook secret that triggered a build. + type: str + image_change_build: + description: + - imageChangeBuild stores information about an imagechange event that triggered + a new build. + type: complex + contains: + from_ref: + description: + - fromRef contains detailed information about an image that triggered + a build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + image_id: + description: + - imageID is the ID of the image that triggered a a new build. + type: str + message: + description: + - 'message is used to store a human readable message for why the build was + triggered. E.g.: "Manually triggered by user", "Configuration change",etc.' + type: str + triggered_by_image: + description: + - triggeredByImage is the Image that triggered this build. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('build_request', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_network.py b/library/k8s_v1_cluster_network.py new file mode 100644 index 00000000..963da81c --- /dev/null +++ b/library/k8s_v1_cluster_network.py @@ -0,0 +1,322 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_network +short_description: Kubernetes ClusterNetwork +description: +- Manage the lifecycle of a cluster_network object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + hostsubnetlength: + description: + - HostSubnetLength is the number of bits of network to allocate to each node. + eg, 8 would mean that each node would have a /24 slice of the overlay network + for its pods + type: int + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + network: + description: + - Network is a CIDR string specifying the global overlay network's L3 space + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + plugin_name: + description: + - PluginName is the name of the network plugin being used + service_network: + description: + - ServiceNetwork is the CIDR range that Service IP addresses are allocated from + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_network: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + hostsubnetlength: + description: + - HostSubnetLength is the number of bits of network to allocate to each node. + eg, 8 would mean that each node would have a /24 slice of the overlay network + for its pods + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + network: + description: + - Network is a CIDR string specifying the global overlay network's L3 space + type: str + plugin_name: + description: + - PluginName is the name of the network plugin being used + type: str + service_network: + description: + - ServiceNetwork is the CIDR range that Service IP addresses are allocated from + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_network', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_network_list.py b/library/k8s_v1_cluster_network_list.py new file mode 100644 index 00000000..46cdd000 --- /dev/null +++ b/library/k8s_v1_cluster_network_list.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_network_list +short_description: Kubernetes ClusterNetworkList +description: +- Retrieve a list of cluster_networks. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_network_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of cluster networks + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + hostsubnetlength: + description: + - HostSubnetLength is the number of bits of network to allocate to each + node. eg, 8 would mean that each node would have a /24 slice of the overlay + network for its pods + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + network: + description: + - Network is a CIDR string specifying the global overlay network's L3 space + type: str + plugin_name: + description: + - PluginName is the name of the network plugin being used + type: str + service_network: + description: + - ServiceNetwork is the CIDR range that Service IP addresses are allocated + from + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_network_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_policy.py b/library/k8s_v1_cluster_policy.py new file mode 100644 index 00000000..229b08a9 --- /dev/null +++ b/library/k8s_v1_cluster_policy.py @@ -0,0 +1,540 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_policy +short_description: Kubernetes ClusterPolicy +description: +- Manage the lifecycle of a cluster_policy object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + roles: + description: + - Roles holds all the ClusterRoles held by this ClusterPolicy, mapped by ClusterRole.Name + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_policy: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the ClusterPolicy was created, + updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + roles: + description: + - Roles holds all the ClusterRoles held by this ClusterPolicy, mapped by ClusterRole.Name + type: list + contains: + name: + description: + - Name is the name of the cluster role + type: str + role: + description: + - Role is the cluster role being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this ClusterRole + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against + one of the enumerated resources in either the kubernetes or the + origin API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should + have access to. *s are allowed, but only as the full, final step + in the path This name is intentionally different than the internal + type so that the DefaultConvert works nicely and because the ordering + may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule + applies to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and + AttributeRestrictions contained in this rule. VerbAll represents + all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_policy', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_policy_binding.py b/library/k8s_v1_cluster_policy_binding.py new file mode 100644 index 00000000..5b4553bf --- /dev/null +++ b/library/k8s_v1_cluster_policy_binding.py @@ -0,0 +1,676 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_policy_binding +short_description: Kubernetes ClusterPolicyBinding +description: +- Manage the lifecycle of a cluster_policy_binding object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + policy_ref_api_version: + description: + - API version of the referent. + aliases: + - api_version + policy_ref_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + policy_ref_kind: + description: + - Kind of the referent. + aliases: + - kind + policy_ref_name: + description: + - Name of the referent. + aliases: + - name + policy_ref_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + policy_ref_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + policy_ref_uid: + description: + - UID of the referent. + aliases: + - uid + role_bindings: + description: + - RoleBindings holds all the ClusterRoleBindings held by this ClusterPolicyBinding, + mapped by ClusterRoleBinding.Name + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_policy_binding: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the ClusterPolicyBinding was + created, updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + policy_ref: + description: + - PolicyRef is a reference to the ClusterPolicy that contains all the ClusterRoles + that this ClusterPolicyBinding's RoleBindings may reference + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + role_bindings: + description: + - RoleBindings holds all the ClusterRoleBindings held by this ClusterPolicyBinding, + mapped by ClusterRoleBinding.Name + type: list + contains: + name: + description: + - Name is the name of the cluster role binding + type: str + role_binding: + description: + - RoleBinding is the cluster role binding being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field + should only be specified when supporting legacy clients and servers. + See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the ClusterRoleRef cannot be resolved, the Authorizer must return + an error. Since Policy is a singleton, this is sufficient knowledge + to locate a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This + field is ignored if UserNames or GroupNames are specified to support + legacy clients and servers. Thus newer clients that do not need to + support backwards compatibility should send only fully qualified Subjects + and should omit the UserNames and GroupNames fields. Clients that + need to support backwards compatibility can use this field to build + the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This + field should only be specified when supporting legacy clients and + servers. See Subjects for further details. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_policy_binding', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_policy_binding_list.py b/library/k8s_v1_cluster_policy_binding_list.py new file mode 100644 index 00000000..444663e9 --- /dev/null +++ b/library/k8s_v1_cluster_policy_binding_list.py @@ -0,0 +1,663 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_policy_binding_list +short_description: Kubernetes ClusterPolicyBindingList +description: +- Retrieve a list of cluster_policy_bindings. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_policy_binding_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ClusterPolicyBindings + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the ClusterPolicyBinding + was created, updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + policy_ref: + description: + - PolicyRef is a reference to the ClusterPolicy that contains all the ClusterRoles + that this ClusterPolicyBinding's RoleBindings may reference + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + role_bindings: + description: + - RoleBindings holds all the ClusterRoleBindings held by this ClusterPolicyBinding, + mapped by ClusterRoleBinding.Name + type: list + contains: + name: + description: + - Name is the name of the cluster role binding + type: str + role_binding: + description: + - RoleBinding is the cluster role binding being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This + field should only be specified when supporting legacy clients + and servers. See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global + namespace. If the ClusterRoleRef cannot be resolved, the Authorizer + must return an error. Since Policy is a singleton, this is sufficient + knowledge to locate a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This + field is ignored if UserNames or GroupNames are specified to support + legacy clients and servers. Thus newer clients that do not need + to support backwards compatibility should send only fully qualified + Subjects and should omit the UserNames and GroupNames fields. + Clients that need to support backwards compatibility can use this + field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. + This field should only be specified when supporting legacy clients + and servers. See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_policy_binding_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_policy_list.py b/library/k8s_v1_cluster_policy_list.py new file mode 100644 index 00000000..2e35c1f7 --- /dev/null +++ b/library/k8s_v1_cluster_policy_list.py @@ -0,0 +1,566 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_policy_list +short_description: Kubernetes ClusterPolicyList +description: +- Retrieve a list of cluster_policys. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_policy_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ClusterPolicies + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the ClusterPolicy was created, + updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + roles: + description: + - Roles holds all the ClusterRoles held by this ClusterPolicy, mapped by + ClusterRole.Name + type: list + contains: + name: + description: + - Name is the name of the cluster role + type: str + role: + description: + - Role is the cluster role being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this ClusterRole + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API + groups are assumed. That means that if an action is requested + against one of the enumerated resources in either the kubernetes + or the origin API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to + handle the AttributeRestrictions, the Authorizer should report + an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user + should have access to. *s are allowed, but only as the full, + final step in the path This name is intentionally different + than the internal type so that the DefaultConvert works nicely + and because the ordering may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the + rule applies to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds + and AttributeRestrictions contained in this rule. VerbAll + represents all kinds. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_policy_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_resource_quota.py b/library/k8s_v1_cluster_resource_quota.py new file mode 100644 index 00000000..2822cf78 --- /dev/null +++ b/library/k8s_v1_cluster_resource_quota.py @@ -0,0 +1,443 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_resource_quota +short_description: Kubernetes ClusterResourceQuota +description: +- Manage the lifecycle of a cluster_resource_quota object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_quota_hard: + description: + - Hard is the set of desired hard limits for each named resource. + aliases: + - quota_hard + type: dict + spec_quota_scopes: + description: + - A collection of filters that must match each object tracked by a quota. If not + specified, the quota matches all objects. + aliases: + - quota_scopes + type: list + spec_selector_annotations: + description: + - AnnotationSelector is used to select projects by annotation. + aliases: + - selector_annotations + type: dict + spec_selector_labels_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_labels_match_expressions + type: list + spec_selector_labels_match_labels: + description: + - 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. + aliases: + - selector_labels_match_labels + type: dict + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_resource_quota: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired quota + type: complex + contains: + quota: + description: + - Quota defines the desired quota + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by a quota. + If not specified, the quota matches all objects. + type: list + contains: str + selector: + description: + - Selector is the selector used to match projects. It should only select + active projects on the scale of dozens (though it can select many more + less active projects). These projects will contend on object creation + through this resource. + type: complex + contains: + annotations: + description: + - AnnotationSelector is used to select projects by annotation. + type: complex + contains: str, str + labels: + description: + - LabelSelector is used to select projects by label. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Status defines the actual enforced quota and its current usage + type: complex + contains: + namespaces: + description: + - Namespaces slices the usage by project. This division allows for quick + resolution of deletion reconciliation inside of a single project without + requiring a recalculation across all projects. This can be used to pull + the deltas for a given project. + type: list + contains: + namespace: + description: + - Namespace the project this status applies to + type: str + status: + description: + - Status indicates how many resources have been consumed by this project + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the + namespace. + type: complex + contains: str, ResourceQuantity + total: + description: + - Total defines the actual enforced quota and its current usage across all + projects + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the namespace. + type: complex + contains: str, ResourceQuantity +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_resource_quota', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_resource_quota_list.py b/library/k8s_v1_cluster_resource_quota_list.py new file mode 100644 index 00000000..4fa22201 --- /dev/null +++ b/library/k8s_v1_cluster_resource_quota_list.py @@ -0,0 +1,432 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_resource_quota_list +short_description: Kubernetes ClusterResourceQuotaList +description: +- Retrieve a list of cluster_resource_quotas. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_resource_quota_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ClusterResourceQuotas + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired quota + type: complex + contains: + quota: + description: + - Quota defines the desired quota + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by + a quota. If not specified, the quota matches all objects. + type: list + contains: str + selector: + description: + - Selector is the selector used to match projects. It should only select + active projects on the scale of dozens (though it can select many + more less active projects). These projects will contend on object + creation through this resource. + type: complex + contains: + annotations: + description: + - AnnotationSelector is used to select projects by annotation. + type: complex + contains: str, str + labels: + description: + - LabelSelector is used to select projects by label. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Status defines the actual enforced quota and its current usage + type: complex + contains: + namespaces: + description: + - Namespaces slices the usage by project. This division allows for quick + resolution of deletion reconciliation inside of a single project without + requiring a recalculation across all projects. This can be used to + pull the deltas for a given project. + type: list + contains: + namespace: + description: + - Namespace the project this status applies to + type: str + status: + description: + - Status indicates how many resources have been consumed by this + project + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in + the namespace. + type: complex + contains: str, ResourceQuantity + total: + description: + - Total defines the actual enforced quota and its current usage across + all projects + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the + namespace. + type: complex + contains: str, ResourceQuantity + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_resource_quota_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_role.py b/library/k8s_v1_cluster_role.py new file mode 100644 index 00000000..530a1e0b --- /dev/null +++ b/library/k8s_v1_cluster_role.py @@ -0,0 +1,344 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_role +short_description: Kubernetes ClusterRole +description: +- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + rules: + description: + - Rules holds all the PolicyRules for this ClusterRole + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_role: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this ClusterRole + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. If + this field is empty, then both kubernetes and origin API groups are assumed. + That means that if an action is requested against one of the enumerated + resources in either the kubernetes or the origin API group, the request + will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle the + AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the path + This name is intentionally different than the internal type so that the + DefaultConvert works nicely and because the ordering may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll represents + all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_role', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_role_binding.py b/library/k8s_v1_cluster_role_binding.py new file mode 100644 index 00000000..ddff5f90 --- /dev/null +++ b/library/k8s_v1_cluster_role_binding.py @@ -0,0 +1,452 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_role_binding +short_description: Kubernetes ClusterRoleBinding +description: +- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects for + further details. + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + role_ref_api_version: + description: + - API version of the referent. + aliases: + - api_version + role_ref_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + role_ref_kind: + description: + - Kind of the referent. + aliases: + - kind + role_ref_name: + description: + - Name of the referent. + aliases: + - name + role_ref_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + role_ref_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + role_ref_uid: + description: + - UID of the referent. + aliases: + - uid + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + subjects: + description: + - Subjects hold object references to authorize with this rule. This field is ignored + if UserNames or GroupNames are specified to support legacy clients and servers. + Thus newer clients that do not need to support backwards compatibility should + send only fully qualified Subjects and should omit the UserNames and GroupNames + fields. Clients that need to support backwards compatibility can use this field + to build the UserNames and GroupNames. + type: list + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects for + further details. + type: list + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_role_binding: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects + for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the ClusterRoleRef cannot be resolved, the Authorizer must return an error. + Since Policy is a singleton, this is sufficient knowledge to locate a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This field is + ignored if UserNames or GroupNames are specified to support legacy clients + and servers. Thus newer clients that do not need to support backwards compatibility + should send only fully qualified Subjects and should omit the UserNames and + GroupNames fields. Clients that need to support backwards compatibility can + use this field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects + for further details. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_role_binding', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_role_binding_list.py b/library/k8s_v1_cluster_role_binding_list.py new file mode 100644 index 00000000..c1969bcf --- /dev/null +++ b/library/k8s_v1_cluster_role_binding_list.py @@ -0,0 +1,414 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_role_binding_list +short_description: Kubernetes ClusterRoleBindingList +description: +- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_role_binding_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ClusterRoleBindings + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field + should only be specified when supporting legacy clients and servers. See + Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the ClusterRoleRef cannot be resolved, the Authorizer must return an + error. Since Policy is a singleton, this is sufficient knowledge to locate + a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This field + is ignored if UserNames or GroupNames are specified to support legacy + clients and servers. Thus newer clients that do not need to support backwards + compatibility should send only fully qualified Subjects and should omit + the UserNames and GroupNames fields. Clients that need to support backwards + compatibility can use this field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field + should only be specified when supporting legacy clients and servers. See + Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_role_binding_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_cluster_role_list.py b/library/k8s_v1_cluster_role_list.py new file mode 100644 index 00000000..fa591690 --- /dev/null +++ b/library/k8s_v1_cluster_role_list.py @@ -0,0 +1,362 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_cluster_role_list +short_description: Kubernetes ClusterRoleList +description: +- Retrieve a list of cluster_roles. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cluster_role_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ClusterRoles + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this ClusterRole + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against one + of the enumerated resources in either the kubernetes or the origin + API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the + path This name is intentionally different than the internal type so + that the DefaultConvert works nicely and because the ordering may + be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cluster_role_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_component_status.py b/library/k8s_v1_component_status.py new file mode 100644 index 00000000..be45d6d5 --- /dev/null +++ b/library/k8s_v1_component_status.py @@ -0,0 +1,305 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_component_status +short_description: Kubernetes ComponentStatus +description: +- Manage the lifecycle of a component_status object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + conditions: + description: + - List of component conditions observed + type: list + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +component_status: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + conditions: + description: + - List of component conditions observed + type: list + contains: + error: + description: + - Condition error code for a component. For example, a health check error + code. + type: str + message: + description: + - Message about the condition for a component. For example, information + about a health check. + type: str + status: + description: + - 'Status of the condition for a component. Valid values for "Healthy": + "True", "False", or "Unknown".' + type: str + type: + description: + - 'Type of condition for a component. Valid value: "Healthy"' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('component_status', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_component_status_list.py b/library/k8s_v1_component_status_list.py new file mode 100644 index 00000000..0a8699e8 --- /dev/null +++ b/library/k8s_v1_component_status_list.py @@ -0,0 +1,322 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_component_status_list +short_description: Kubernetes ComponentStatusList +description: +- Retrieve a list of component_status. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +component_status_list: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of ComponentStatus objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + conditions: + description: + - List of component conditions observed + type: list + contains: + error: + description: + - Condition error code for a component. For example, a health check + error code. + type: str + message: + description: + - Message about the condition for a component. For example, information + about a health check. + type: str + status: + description: + - 'Status of the condition for a component. Valid values for "Healthy": + "True", "False", or "Unknown".' + type: str + type: + description: + - 'Type of condition for a component. Valid value: "Healthy"' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('component_status_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_config_map.py b/library/k8s_v1_config_map.py new file mode 100644 index 00000000..f1efd8ea --- /dev/null +++ b/library/k8s_v1_config_map.py @@ -0,0 +1,300 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_config_map +short_description: Kubernetes ConfigMap +description: +- Manage the lifecycle of a config_map object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + data: + description: + - Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN + with an optional leading dot. + type: dict + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +config_map: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + data: + description: + - Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN + with an optional leading dot. + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('config_map', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_config_map_list.py b/library/k8s_v1_config_map_list.py new file mode 100644 index 00000000..3bf87b33 --- /dev/null +++ b/library/k8s_v1_config_map_list.py @@ -0,0 +1,316 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_config_map_list +short_description: Kubernetes ConfigMapList +description: +- Retrieve a list of config_maps. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +config_map_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of ConfigMaps. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + data: + description: + - Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN + with an optional leading dot. + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - '' + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('config_map_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_deployment_config.py b/library/k8s_v1_deployment_config.py new file mode 100644 index 00000000..8c7e0744 --- /dev/null +++ b/library/k8s_v1_deployment_config.py @@ -0,0 +1,2751 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_deployment_config +short_description: Kubernetes DeploymentConfig +description: +- Manage the lifecycle of a deployment_config object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_min_ready_seconds: + description: + - MinReadySeconds is the minimum number of seconds for which a newly created pod + should be ready without any of its container crashing, for it to be considered + available. Defaults to 0 (pod will be considered available as soon as it is + ready) + aliases: + - min_ready_seconds + type: int + spec_paused: + description: + - Paused indicates that the deployment config is paused resulting in no new deployments + on template changes or changes in the template caused by other triggers. + aliases: + - paused + type: bool + spec_replicas: + description: + - Replicas is the number of desired replicas. + aliases: + - replicas + type: int + spec_revision_history_limit: + description: + - RevisionHistoryLimit is the number of old ReplicationControllers to retain to + allow for rollbacks. This field is a pointer to allow for differentiation between + an explicit zero and not specified. + aliases: + - revision_history_limit + type: int + spec_selector: + description: + - Selector is a label query over pods that should match the Replicas count. + aliases: + - selector + type: dict + spec_strategy_active_deadline_seconds: + description: + - ActiveDeadlineSeconds is the duration in seconds that the deployer pods for + this deployment config may be active on a node before the system actively tries + to terminate them. + aliases: + - strategy_active_deadline_seconds + type: int + spec_strategy_annotations: + description: + - Annotations is a set of key, value pairs added to custom deployer and lifecycle + pre/post hook pods. + aliases: + - strategy_annotations + type: dict + spec_strategy_custom_params: + description: + - When C(spec_strategy_type) is I(Custom), provide a mapping of 'key:value' settings. + aliases: + - strategy_custom_params + type: dict + spec_strategy_labels: + description: + - Labels is a set of key, value pairs added to custom deployer and lifecycle pre/post + hook pods. + aliases: + - strategy_labels + type: dict + spec_strategy_recreate_params: + description: + - When C(spec_strategy_type) is I(Recreate), provide a mapping of 'key:value' + settings. + aliases: + - strategy_recreate_params + type: dict + spec_strategy_resources_limits: + description: + - Limits describes the maximum amount of compute resources allowed. + aliases: + - strategy_resources_limits + type: dict + spec_strategy_resources_requests: + description: + - Requests describes the minimum amount of compute resources required. If Requests + is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + aliases: + - strategy_resources_requests + type: dict + spec_strategy_rolling_params: + description: + - When C(spec_strategy_type) is I(Rolling), provide a mapping of 'key:value' settings. + aliases: + - strategy_rolling_params + type: dict + spec_strategy_type: + description: + - Type is the name of a deployment strategy. + choices: + - Rolling + - Custom + - Recreate + aliases: + - strategy_type + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + spec_test: + description: + - Test ensures that this deployment config will have zero replicas except while + a deployment is running. This allows the deployment config to be used as a continuous + deployment test - triggering on images, running the deployment, and then succeeding + or failing. Post strategy hooks and After actions can be used to integrate successful + deployment with an action. + aliases: + - test + type: bool + spec_triggers: + description: + - Triggers determine how updates to a DeploymentConfig result in new deployments. + If no triggers are defined, a new deployment can only occur as a result of an + explicit client update to the DeploymentConfig with a new LatestVersion. If + null, defaults to having a config change trigger. + aliases: + - triggers + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +- name: Create deployment config + k8s_v1_deployment_config: + name: frontend + namespace: k8s-project + state: present + spec_template_metadata_labels: + name: frontend + containers: + - name: helloworld + image: openshift/origin-ruby-sample + ports: + - container_port: 8080 + protocol: TCP + name: http-port + replicas: 5 + selector: + name: frontend + triggers: + - type: ConfigChange + - type: ImageChange + image_change_params: + automatic: true + container_names: + - helloworld + _from: + kind: ImageStreamTag + name: origin-ruby-sample:latest + strategy_type: Rolling + +- name: Patch deployment config + k8s_v1_deployment_config: + name: frontend + namespace: k8s-project + state: present + spec_template_metadata_labels: + name: frontend + containers: + - name: helloworld + image: openshift/origin-ruby-sample:v1.0 + ports: + - container_port: 9000 + protocol: UDP + name: udp-port + replicas: 3 + +- name: Replace deployment config + k8s_v1_deployment_config: + name: frontend + namespace: k8s-project + state: replaced + spec_template_metadata_labels: + name: frontend_app + containers: + - name: helloworld + image: openshift/origin-ruby-sample:v2 + ports: + - container_port: 8888 + protocol: TCP + name: http-port + replicas: 2 + selector: + name: frontend_app + triggers: + - type: ConfigChange + - type: ImageChange + image_change_params: + automatic: true + container_names: + - helloworld + _from: + kind: ImageStreamTag + name: origin-ruby-sample:v2 + strategy_type: Rolling + +- name: Remove deployment config + k8s_v1_deployment_config: + name: frontend + namespace: k8s-project + state: absent +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +deployment_config: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec represents a desired deployment state and how to deploy to it. + type: complex + contains: + min_ready_seconds: + description: + - MinReadySeconds is the minimum number of seconds for which a newly created + pod should be ready without any of its container crashing, for it to be + considered available. Defaults to 0 (pod will be considered available + as soon as it is ready) + type: int + paused: + description: + - Paused indicates that the deployment config is paused resulting in no + new deployments on template changes or changes in the template caused + by other triggers. + type: bool + replicas: + description: + - Replicas is the number of desired replicas. + type: int + revision_history_limit: + description: + - RevisionHistoryLimit is the number of old ReplicationControllers to retain + to allow for rollbacks. This field is a pointer to allow for differentiation + between an explicit zero and not specified. + type: int + selector: + description: + - Selector is a label query over pods that should match the Replicas count. + type: complex + contains: str, str + strategy: + description: + - Strategy describes how a deployment is executed. + type: complex + contains: + active_deadline_seconds: + description: + - ActiveDeadlineSeconds is the duration in seconds that the deployer + pods for this deployment config may be active on a node before the + system actively tries to terminate them. + type: int + annotations: + description: + - Annotations is a set of key, value pairs added to custom deployer + and lifecycle pre/post hook pods. + type: complex + contains: str, str + custom_params: + description: Deployment strategy parameters when I(type) is Custom. + type: complex + returned: when I(type) is Custom + labels: + description: + - Labels is a set of key, value pairs added to custom deployer and lifecycle + pre/post hook pods. + type: complex + contains: str, str + recreate_params: + description: Deployment strategy parameters when I(type) is Recreate. + type: complex + returned: when I(type) is Recreate + resources: + description: + - Resources contains resource requirements to execute the deployment + and any hooks. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + rolling_params: + description: Deployment strategy parameters when I(type) is Rolling. + type: complex + returned: when I(type) is Rolling + type: + description: + - Type is the name of a deployment strategy. + type: str + template: + description: + - Template is the object that describes the pod that will be created if + insufficient replicas are detected. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + test: + description: + - Test ensures that this deployment config will have zero replicas except + while a deployment is running. This allows the deployment config to be + used as a continuous deployment test - triggering on images, running the + deployment, and then succeeding or failing. Post strategy hooks and After + actions can be used to integrate successful deployment with an action. + type: bool + triggers: + description: + - Triggers determine how updates to a DeploymentConfig result in new deployments. + If no triggers are defined, a new deployment can only occur as a result + of an explicit client update to the DeploymentConfig with a new LatestVersion. + If null, defaults to having a config change trigger. + type: list + contains: + image_change_params: + description: Deployment trigger policy parameters when I(type) is ImageChange. + type: complex + returned: when I(type) is ImageChange + type: + description: + - Type of the trigger + type: str + status: + description: + - Status represents the current deployment state. + type: complex + contains: + available_replicas: + description: + - AvailableReplicas is the total number of available pods targeted by this + deployment config. + type: int + conditions: + description: + - Conditions represents the latest available observations of a deployment + config's current state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + last_update_time: + description: + - The last time this condition was updated. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of deployment condition. + type: str + details: + description: + - Details are the reasons for the update to this deployment config. This + could be based on a change made by the user or caused by an automatic + trigger + type: complex + contains: + causes: + description: + - Causes are extended data associated with all the causes for creating + a new deployment + type: list + contains: + image_trigger: + description: + - ImageTrigger contains the image trigger details, if this trigger + was fired based on an image change + type: complex + contains: + _from: + description: + - From is a reference to the changed object which triggered + a deployment. The field may have the kinds DockerImage, ImageStreamTag, + or ImageStreamImage. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + type: + description: + - Type of the trigger that resulted in the creation of a new deployment + type: str + message: + description: + - Message is the user specified change message, if this deployment was + triggered manually by the user + type: str + latest_version: + description: + - LatestVersion is used to determine whether the current deployment associated + with a deployment config is out of sync. + type: int + observed_generation: + description: + - ObservedGeneration is the most recent generation observed by the deployment + config controller. + type: int + ready_replicas: + description: + - Total number of ready pods targeted by this deployment. + type: int + replicas: + description: + - Replicas is the total number of pods targeted by this deployment config. + type: int + unavailable_replicas: + description: + - UnavailableReplicas is the total number of unavailable pods targeted by + this deployment config. + type: int + updated_replicas: + description: + - UpdatedReplicas is the total number of non-terminated pods targeted by + this deployment config that have the desired template spec. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('deployment_config', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_deployment_config_list.py b/library/k8s_v1_deployment_config_list.py new file mode 100644 index 00000000..429f3fd0 --- /dev/null +++ b/library/k8s_v1_deployment_config_list.py @@ -0,0 +1,2431 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_deployment_config_list +short_description: Kubernetes DeploymentConfigList +description: +- Retrieve a list of deployment_configs. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +deployment_config_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of deployment configs + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec represents a desired deployment state and how to deploy to it. + type: complex + contains: + min_ready_seconds: + description: + - MinReadySeconds is the minimum number of seconds for which a newly + created pod should be ready without any of its container crashing, + for it to be considered available. Defaults to 0 (pod will be considered + available as soon as it is ready) + type: int + paused: + description: + - Paused indicates that the deployment config is paused resulting in + no new deployments on template changes or changes in the template + caused by other triggers. + type: bool + replicas: + description: + - Replicas is the number of desired replicas. + type: int + revision_history_limit: + description: + - RevisionHistoryLimit is the number of old ReplicationControllers to + retain to allow for rollbacks. This field is a pointer to allow for + differentiation between an explicit zero and not specified. + type: int + selector: + description: + - Selector is a label query over pods that should match the Replicas + count. + type: complex + contains: str, str + strategy: + description: + - Strategy describes how a deployment is executed. + type: complex + contains: + active_deadline_seconds: + description: + - ActiveDeadlineSeconds is the duration in seconds that the deployer + pods for this deployment config may be active on a node before + the system actively tries to terminate them. + type: int + annotations: + description: + - Annotations is a set of key, value pairs added to custom deployer + and lifecycle pre/post hook pods. + type: complex + contains: str, str + custom_params: + description: Deployment strategy parameters when I(type) is Custom. + type: complex + returned: when I(type) is Custom + labels: + description: + - Labels is a set of key, value pairs added to custom deployer and + lifecycle pre/post hook pods. + type: complex + contains: str, str + recreate_params: + description: Deployment strategy parameters when I(type) is Recreate. + type: complex + returned: when I(type) is Recreate + resources: + description: + - Resources contains resource requirements to execute the deployment + and any hooks. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to an + implementation-defined value. + type: complex + contains: str, ResourceQuantity + rolling_params: + description: Deployment strategy parameters when I(type) is Rolling. + type: complex + returned: when I(type) is Rolling + type: + description: + - Type is the name of a deployment strategy. + type: str + template: + description: + - Template is the object that describes the pod that will be created + if insufficient replicas are detected. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + test: + description: + - Test ensures that this deployment config will have zero replicas except + while a deployment is running. This allows the deployment config to + be used as a continuous deployment test - triggering on images, running + the deployment, and then succeeding or failing. Post strategy hooks + and After actions can be used to integrate successful deployment with + an action. + type: bool + triggers: + description: + - Triggers determine how updates to a DeploymentConfig result in new + deployments. If no triggers are defined, a new deployment can only + occur as a result of an explicit client update to the DeploymentConfig + with a new LatestVersion. If null, defaults to having a config change + trigger. + type: list + contains: + image_change_params: + description: Deployment trigger policy parameters when I(type) is + ImageChange. + type: complex + returned: when I(type) is ImageChange + type: + description: + - Type of the trigger + type: str + status: + description: + - Status represents the current deployment state. + type: complex + contains: + available_replicas: + description: + - AvailableReplicas is the total number of available pods targeted by + this deployment config. + type: int + conditions: + description: + - Conditions represents the latest available observations of a deployment + config's current state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + last_update_time: + description: + - The last time this condition was updated. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of deployment condition. + type: str + details: + description: + - Details are the reasons for the update to this deployment config. + This could be based on a change made by the user or caused by an automatic + trigger + type: complex + contains: + causes: + description: + - Causes are extended data associated with all the causes for creating + a new deployment + type: list + contains: + image_trigger: + description: + - ImageTrigger contains the image trigger details, if this trigger + was fired based on an image change + type: complex + contains: + _from: + description: + - From is a reference to the changed object which triggered + a deployment. The field may have the kinds DockerImage, + ImageStreamTag, or ImageStreamImage. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an + entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container + that triggered the event) or if no container name + is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to + have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is + made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + type: + description: + - Type of the trigger that resulted in the creation of a new + deployment + type: str + message: + description: + - Message is the user specified change message, if this deployment + was triggered manually by the user + type: str + latest_version: + description: + - LatestVersion is used to determine whether the current deployment + associated with a deployment config is out of sync. + type: int + observed_generation: + description: + - ObservedGeneration is the most recent generation observed by the deployment + config controller. + type: int + ready_replicas: + description: + - Total number of ready pods targeted by this deployment. + type: int + replicas: + description: + - Replicas is the total number of pods targeted by this deployment config. + type: int + unavailable_replicas: + description: + - UnavailableReplicas is the total number of unavailable pods targeted + by this deployment config. + type: int + updated_replicas: + description: + - UpdatedReplicas is the total number of non-terminated pods targeted + by this deployment config that have the desired template spec. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('deployment_config_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_deployment_config_rollback.py b/library/k8s_v1_deployment_config_rollback.py new file mode 100644 index 00000000..b573b68a --- /dev/null +++ b/library/k8s_v1_deployment_config_rollback.py @@ -0,0 +1,257 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_deployment_config_rollback +short_description: Kubernetes DeploymentConfigRollback +description: +- Manage the lifecycle of a deployment_config_rollback object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + name: + description: + - Name of the deployment config that will be rolled back. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec__from_api_version: + description: + - API version of the referent. + aliases: + - _from_api_version + spec__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - _from_field_path + spec__from_kind: + description: + - Kind of the referent. + aliases: + - _from_kind + spec__from_name: + description: + - Name of the referent. + aliases: + - _from_name + spec__from_namespace: + description: + - Namespace of the referent. + aliases: + - _from_namespace + spec__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - _from_resource_version + spec__from_uid: + description: + - UID of the referent. + aliases: + - _from_uid + spec_include_replication_meta: + description: + - IncludeReplicationMeta specifies whether to include the replica count and selector. + aliases: + - include_replication_meta + type: bool + spec_include_strategy: + description: + - IncludeStrategy specifies whether to include the deployment Strategy. + aliases: + - include_strategy + type: bool + spec_include_template: + description: + - IncludeTemplate specifies whether to include the PodTemplateSpec. + aliases: + - include_template + type: bool + spec_include_triggers: + description: + - IncludeTriggers specifies whether to include config Triggers. + aliases: + - include_triggers + type: bool + spec_revision: + description: + - Revision to rollback to. If set to 0, rollback to the last revision. + aliases: + - revision + type: int + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + updated_annotations: + description: + - UpdatedAnnotations is a set of new annotations that will be added in the deployment + config. + type: dict + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +deployment_config_rollback: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + name: + description: + - Name of the deployment config that will be rolled back. + type: str + spec: + description: + - Spec defines the options to rollback generation. + type: complex + contains: + _from: + description: + - From points to a ReplicationController which is a deployment. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + include_replication_meta: + description: + - IncludeReplicationMeta specifies whether to include the replica count + and selector. + type: bool + include_strategy: + description: + - IncludeStrategy specifies whether to include the deployment Strategy. + type: bool + include_template: + description: + - IncludeTemplate specifies whether to include the PodTemplateSpec. + type: bool + include_triggers: + description: + - IncludeTriggers specifies whether to include config Triggers. + type: bool + revision: + description: + - Revision to rollback to. If set to 0, rollback to the last revision. + type: int + updated_annotations: + description: + - UpdatedAnnotations is a set of new annotations that will be added in the deployment + config. + type: complex + contains: str, str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('deployment_config_rollback', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_egress_network_policy.py b/library/k8s_v1_egress_network_policy.py new file mode 100644 index 00000000..fbb6f236 --- /dev/null +++ b/library/k8s_v1_egress_network_policy.py @@ -0,0 +1,318 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_egress_network_policy +short_description: Kubernetes EgressNetworkPolicy +description: +- Manage the lifecycle of a egress_network_policy object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_egress: + description: + - egress contains the list of egress policy rules + aliases: + - egress + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +egress_network_policy: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - metadata for EgressNetworkPolicy + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - spec is the specification of the current egress network policy + type: complex + contains: + egress: + description: + - egress contains the list of egress policy rules + type: list + contains: + to: + description: + - to is the target that traffic is allowed/denied to + type: complex + contains: + cidr_selector: + description: + - cidrSelector is the CIDR range to allow/deny traffic to + type: str + type: + description: + - type marks this as an "Allow" or "Deny" rule + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('egress_network_policy', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_egress_network_policy_list.py b/library/k8s_v1_egress_network_policy_list.py new file mode 100644 index 00000000..eb5d201c --- /dev/null +++ b/library/k8s_v1_egress_network_policy_list.py @@ -0,0 +1,333 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_egress_network_policy_list +short_description: Kubernetes EgressNetworkPolicyList +description: +- Retrieve a list of egress_network_policys. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +egress_network_policy_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - items is the list of policies + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - metadata for EgressNetworkPolicy + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - spec is the specification of the current egress network policy + type: complex + contains: + egress: + description: + - egress contains the list of egress policy rules + type: list + contains: + to: + description: + - to is the target that traffic is allowed/denied to + type: complex + contains: + cidr_selector: + description: + - cidrSelector is the CIDR range to allow/deny traffic to + type: str + type: + description: + - type marks this as an "Allow" or "Deny" rule + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - metadata for EgressNetworkPolicyList + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('egress_network_policy_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_endpoints.py b/library/k8s_v1_endpoints.py new file mode 100644 index 00000000..3c3e537c --- /dev/null +++ b/library/k8s_v1_endpoints.py @@ -0,0 +1,455 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_endpoints +short_description: Kubernetes Endpoints +description: +- Manage the lifecycle of a endpoints object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + subsets: + description: + - The set of all endpoints is the union of all subsets. Addresses are placed into + subsets according to the IPs they share. A single address with multiple ports, + some of which are ready and some of which are not (because they come from different + containers) will result in the address being displayed in different subsets + for the different ports. No address will appear in both Addresses and NotReadyAddresses + in the same subset. Sets of addresses and ports that comprise a service. + type: list + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +endpoints: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + subsets: + description: + - The set of all endpoints is the union of all subsets. Addresses are placed + into subsets according to the IPs they share. A single address with multiple + ports, some of which are ready and some of which are not (because they come + from different containers) will result in the address being displayed in different + subsets for the different ports. No address will appear in both Addresses + and NotReadyAddresses in the same subset. Sets of addresses and ports that + comprise a service. + type: list + contains: + addresses: + description: + - IP addresses which offer the related ports that are marked as ready. These + endpoints should be considered safe for load balancers and clients to + utilize. + type: list + contains: + hostname: + description: + - The Hostname of this endpoint + type: str + ip: + description: + - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local + (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is + also accepted but not fully supported on all platforms. Also, certain + kubernetes components, like kube-proxy, are not IPv6 ready. + type: str + node_name: + description: + - 'Optional: Node hosting this endpoint. This can be used to determine + endpoints local to a node.' + type: str + target_ref: + description: + - Reference to object providing the endpoint. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + not_ready_addresses: + description: + - IP addresses which offer the related ports but are not currently marked + as ready because they have not yet finished starting, have recently failed + a readiness check, or have recently failed a liveness check. + type: list + contains: + hostname: + description: + - The Hostname of this endpoint + type: str + ip: + description: + - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local + (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is + also accepted but not fully supported on all platforms. Also, certain + kubernetes components, like kube-proxy, are not IPv6 ready. + type: str + node_name: + description: + - 'Optional: Node hosting this endpoint. This can be used to determine + endpoints local to a node.' + type: str + target_ref: + description: + - Reference to object providing the endpoint. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + ports: + description: + - Port numbers available on the related IP addresses. + type: list + contains: + name: + description: + - The name of this port (corresponds to ServicePort.Name). Must be a + DNS_LABEL. Optional only if one port is defined. + type: str + port: + description: + - The port number of the endpoint. + type: int + protocol: + description: + - The IP protocol for this port. Must be UDP or TCP. Default is TCP. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('endpoints', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_endpoints_list.py b/library/k8s_v1_endpoints_list.py new file mode 100644 index 00000000..cfd1cbe0 --- /dev/null +++ b/library/k8s_v1_endpoints_list.py @@ -0,0 +1,472 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_endpoints_list +short_description: Kubernetes EndpointsList +description: +- Retrieve a list of endpoints. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +endpoints_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of endpoints. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + subsets: + description: + - The set of all endpoints is the union of all subsets. Addresses are placed + into subsets according to the IPs they share. A single address with multiple + ports, some of which are ready and some of which are not (because they + come from different containers) will result in the address being displayed + in different subsets for the different ports. No address will appear in + both Addresses and NotReadyAddresses in the same subset. Sets of addresses + and ports that comprise a service. + type: list + contains: + addresses: + description: + - IP addresses which offer the related ports that are marked as ready. + These endpoints should be considered safe for load balancers and clients + to utilize. + type: list + contains: + hostname: + description: + - The Hostname of this endpoint + type: str + ip: + description: + - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local + (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 + is also accepted but not fully supported on all platforms. Also, + certain kubernetes components, like kube-proxy, are not IPv6 ready. + type: str + node_name: + description: + - 'Optional: Node hosting this endpoint. This can be used to determine + endpoints local to a node.' + type: str + target_ref: + description: + - Reference to object providing the endpoint. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + not_ready_addresses: + description: + - IP addresses which offer the related ports but are not currently marked + as ready because they have not yet finished starting, have recently + failed a readiness check, or have recently failed a liveness check. + type: list + contains: + hostname: + description: + - The Hostname of this endpoint + type: str + ip: + description: + - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local + (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 + is also accepted but not fully supported on all platforms. Also, + certain kubernetes components, like kube-proxy, are not IPv6 ready. + type: str + node_name: + description: + - 'Optional: Node hosting this endpoint. This can be used to determine + endpoints local to a node.' + type: str + target_ref: + description: + - Reference to object providing the endpoint. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + ports: + description: + - Port numbers available on the related IP addresses. + type: list + contains: + name: + description: + - The name of this port (corresponds to ServicePort.Name). Must + be a DNS_LABEL. Optional only if one port is defined. + type: str + port: + description: + - The port number of the endpoint. + type: int + protocol: + description: + - The IP protocol for this port. Must be UDP or TCP. Default is + TCP. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('endpoints_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_event.py b/library/k8s_v1_event.py new file mode 100644 index 00000000..2bfa609c --- /dev/null +++ b/library/k8s_v1_event.py @@ -0,0 +1,436 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_event +short_description: Kubernetes Event +description: +- Manage the lifecycle of a event object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + count: + description: + - The number of times this event has occurred. + type: int + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + involved_object_api_version: + description: + - API version of the referent. + aliases: + - api_version + involved_object_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + involved_object_kind: + description: + - Kind of the referent. + aliases: + - kind + involved_object_name: + description: + - Name of the referent. + aliases: + - name + involved_object_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + involved_object_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + involved_object_uid: + description: + - UID of the referent. + aliases: + - uid + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + message: + description: + - A human-readable description of the status of this operation. + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + reason: + description: + - This should be a short, machine understandable string that gives the reason + for the transition into the object's current status. + source_component: + description: + - Component from which the event is generated. + aliases: + - component + source_host: + description: + - Node name on which the event is generated. + aliases: + - host + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + type: + description: + - Type of this event (Normal, Warning), new types could be added in the future + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +event: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + count: + description: + - The number of times this event has occurred. + type: int + first_timestamp: + description: + - The time at which the event was first recorded. (Time of server receipt is + in TypeMeta.) + type: complex + contains: {} + involved_object: + description: + - The object that this event is about. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_timestamp: + description: + - The time at which the most recent occurrence of this event was recorded. + type: complex + contains: {} + message: + description: + - A human-readable description of the status of this operation. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + reason: + description: + - This should be a short, machine understandable string that gives the reason + for the transition into the object's current status. + type: str + source: + description: + - The component reporting this event. Should be a short machine understandable + string. + type: complex + contains: + component: + description: + - Component from which the event is generated. + type: str + host: + description: + - Node name on which the event is generated. + type: str + type: + description: + - Type of this event (Normal, Warning), new types could be added in the future + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('event', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_event_list.py b/library/k8s_v1_event_list.py new file mode 100644 index 00000000..ef66f9d3 --- /dev/null +++ b/library/k8s_v1_event_list.py @@ -0,0 +1,394 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_event_list +short_description: Kubernetes EventList +description: +- Retrieve a list of events. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +event_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of events + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + count: + description: + - The number of times this event has occurred. + type: int + first_timestamp: + description: + - The time at which the event was first recorded. (Time of server receipt + is in TypeMeta.) + type: complex + contains: {} + involved_object: + description: + - The object that this event is about. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + last_timestamp: + description: + - The time at which the most recent occurrence of this event was recorded. + type: complex + contains: {} + message: + description: + - A human-readable description of the status of this operation. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + reason: + description: + - This should be a short, machine understandable string that gives the reason + for the transition into the object's current status. + type: str + source: + description: + - The component reporting this event. Should be a short machine understandable + string. + type: complex + contains: + component: + description: + - Component from which the event is generated. + type: str + host: + description: + - Node name on which the event is generated. + type: str + type: + description: + - Type of this event (Normal, Warning), new types could be added in the + future + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('event_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_group.py b/library/k8s_v1_group.py new file mode 100644 index 00000000..36c6a31b --- /dev/null +++ b/library/k8s_v1_group.py @@ -0,0 +1,298 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_group +short_description: Kubernetes Group +description: +- Manage the lifecycle of a group object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + users: + description: + - Users is the list of users in this group. + type: list + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +group: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + users: + description: + - Users is the list of users in this group. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('group', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_group_list.py b/library/k8s_v1_group_list.py new file mode 100644 index 00000000..b9b21a9f --- /dev/null +++ b/library/k8s_v1_group_list.py @@ -0,0 +1,315 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_group_list +short_description: Kubernetes GroupList +description: +- Retrieve a list of groups. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +group_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of groups + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + users: + description: + - Users is the list of users in this group. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('group_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_horizontal_pod_autoscaler.py b/library/k8s_v1_horizontal_pod_autoscaler.py new file mode 100644 index 00000000..9e1b50ff --- /dev/null +++ b/library/k8s_v1_horizontal_pod_autoscaler.py @@ -0,0 +1,394 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_horizontal_pod_autoscaler +short_description: Kubernetes HorizontalPodAutoscaler +description: +- Manage the lifecycle of a horizontal_pod_autoscaler object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; cannot + be smaller than MinReplicas. + aliases: + - max_replicas + type: int + spec_min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, default + 1. + aliases: + - min_replicas + type: int + spec_scale_target_ref_api_version: + description: + - API version of the referent + aliases: + - scale_target_ref_api_version + spec_scale_target_ref_kind: + description: + - Kind of the referent; + aliases: + - scale_target_ref_kind + spec_scale_target_ref_name: + description: + - Name of the referent; + aliases: + - scale_target_ref_name + spec_target_cpu_utilization_percentage: + description: + - target average CPU utilization (represented as a percentage of requested CPU) + over all the pods; if not specified the default autoscaling policy will be used. + aliases: + - target_cpu_utilization_percentage + type: int + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +horizontal_pod_autoscaler: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - behaviour of autoscaler. + type: complex + contains: + max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; + cannot be smaller than MinReplicas. + type: int + min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, + default 1. + type: int + scale_target_ref: + description: + - reference to scaled resource; horizontal pod autoscaler will learn the + current resource consumption and will set the desired number of pods by + using its Scale subresource. + type: complex + contains: + api_version: + description: + - API version of the referent + type: str + kind: + description: + - Kind of the referent; + type: str + name: + description: + - Name of the referent; + type: str + target_cpu_utilization_percentage: + description: + - target average CPU utilization (represented as a percentage of requested + CPU) over all the pods; if not specified the default autoscaling policy + will be used. + type: int + status: + description: + - current information about the autoscaler. + type: complex + contains: + current_cpu_utilization_percentage: + description: + - current average CPU utilization over all pods, represented as a percentage + of requested CPU, e.g. 70 means that an average pod is using now 70% of + its requested CPU. + type: int + current_replicas: + description: + - current number of replicas of pods managed by this autoscaler. + type: int + desired_replicas: + description: + - desired number of replicas of pods managed by this autoscaler. + type: int + last_scale_time: + description: + - last time the HorizontalPodAutoscaler scaled the number of pods; used + by the autoscaler to control how often the number of pods is changed. + type: complex + contains: {} + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('horizontal_pod_autoscaler', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_horizontal_pod_autoscaler_list.py b/library/k8s_v1_horizontal_pod_autoscaler_list.py new file mode 100644 index 00000000..f0432c68 --- /dev/null +++ b/library/k8s_v1_horizontal_pod_autoscaler_list.py @@ -0,0 +1,379 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_horizontal_pod_autoscaler_list +short_description: Kubernetes HorizontalPodAutoscalerList +description: +- Retrieve a list of horizontal_pod_autoscalers. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +horizontal_pod_autoscaler_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - list of horizontal pod autoscaler objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - behaviour of autoscaler. + type: complex + contains: + max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; + cannot be smaller than MinReplicas. + type: int + min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, + default 1. + type: int + scale_target_ref: + description: + - reference to scaled resource; horizontal pod autoscaler will learn + the current resource consumption and will set the desired number of + pods by using its Scale subresource. + type: complex + contains: + api_version: + description: + - API version of the referent + type: str + kind: + description: + - Kind of the referent; + type: str + name: + description: + - Name of the referent; + type: str + target_cpu_utilization_percentage: + description: + - target average CPU utilization (represented as a percentage of requested + CPU) over all the pods; if not specified the default autoscaling policy + will be used. + type: int + status: + description: + - current information about the autoscaler. + type: complex + contains: + current_cpu_utilization_percentage: + description: + - current average CPU utilization over all pods, represented as a percentage + of requested CPU, e.g. 70 means that an average pod is using now 70% + of its requested CPU. + type: int + current_replicas: + description: + - current number of replicas of pods managed by this autoscaler. + type: int + desired_replicas: + description: + - desired number of replicas of pods managed by this autoscaler. + type: int + last_scale_time: + description: + - last time the HorizontalPodAutoscaler scaled the number of pods; used + by the autoscaler to control how often the number of pods is changed. + type: complex + contains: {} + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('horizontal_pod_autoscaler_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_host_subnet.py b/library/k8s_v1_host_subnet.py new file mode 100644 index 00000000..2f8de836 --- /dev/null +++ b/library/k8s_v1_host_subnet.py @@ -0,0 +1,313 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_host_subnet +short_description: Kubernetes HostSubnet +description: +- Manage the lifecycle of a host_subnet object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Host is the name of the node. (This is redundant with the object's name, and + this field is not actually used any more.) + host_ip: + description: + - HostIP is the IP address to be used as a VTEP by other nodes in the overlay + network + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + subnet: + description: + - Subnet is the CIDR range of the overlay network assigned to the node for its + pods + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +host_subnet: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + host: + description: + - Host is the name of the node. (This is redundant with the object's name, and + this field is not actually used any more.) + type: str + host_ip: + description: + - HostIP is the IP address to be used as a VTEP by other nodes in the overlay + network + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + subnet: + description: + - Subnet is the CIDR range of the overlay network assigned to the node for its + pods + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('host_subnet', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_host_subnet_list.py b/library/k8s_v1_host_subnet_list.py new file mode 100644 index 00000000..023393bf --- /dev/null +++ b/library/k8s_v1_host_subnet_list.py @@ -0,0 +1,325 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_host_subnet_list +short_description: Kubernetes HostSubnetList +description: +- Retrieve a list of host_subnets. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +host_subnet_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of host subnets + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + host: + description: + - Host is the name of the node. (This is redundant with the object's name, + and this field is not actually used any more.) + type: str + host_ip: + description: + - HostIP is the IP address to be used as a VTEP by other nodes in the overlay + network + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + subnet: + description: + - Subnet is the CIDR range of the overlay network assigned to the node for + its pods + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('host_subnet_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_identity.py b/library/k8s_v1_identity.py new file mode 100644 index 00000000..4410a491 --- /dev/null +++ b/library/k8s_v1_identity.py @@ -0,0 +1,394 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_identity +short_description: Kubernetes Identity +description: +- Manage the lifecycle of a identity object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + extra: + description: + - Extra holds extra information about this identity + type: dict + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + provider_name: + description: + - ProviderName is the source of identity information + provider_user_name: + description: + - ProviderUserName uniquely represents this identity in the scope of the provider + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + user_api_version: + description: + - API version of the referent. + aliases: + - api_version + user_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + user_kind: + description: + - Kind of the referent. + aliases: + - kind + user_name: + description: + - Name of the referent. + aliases: + - name + user_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + user_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + user_uid: + description: + - UID of the referent. + aliases: + - uid + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +identity: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + extra: + description: + - Extra holds extra information about this identity + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + provider_name: + description: + - ProviderName is the source of identity information + type: str + provider_user_name: + description: + - ProviderUserName uniquely represents this identity in the scope of the provider + type: str + user: + description: + - User is a reference to the user this identity is associated with Both Name + and UID must be set + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('identity', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_identity_list.py b/library/k8s_v1_identity_list.py new file mode 100644 index 00000000..356262c2 --- /dev/null +++ b/library/k8s_v1_identity_list.py @@ -0,0 +1,366 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_identity_list +short_description: Kubernetes IdentityList +description: +- Retrieve a list of identitys. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +identity_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of identities + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + extra: + description: + - Extra holds extra information about this identity + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + provider_name: + description: + - ProviderName is the source of identity information + type: str + provider_user_name: + description: + - ProviderUserName uniquely represents this identity in the scope of the + provider + type: str + user: + description: + - User is a reference to the user this identity is associated with Both + Name and UID must be set + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('identity_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image.py b/library/k8s_v1_image.py new file mode 100644 index 00000000..57559ebd --- /dev/null +++ b/library/k8s_v1_image.py @@ -0,0 +1,647 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image +short_description: Kubernetes Image +description: +- Manage the lifecycle of a image object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if the + image does not define that data. + type: list + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This is a + part of manifest schema v2. + docker_image_metadata_raw: + description: + - Raw is the underlying serialization of this object. + aliases: + - raw + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if empty + defaults to "1.0" + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is a part + of manifest schema v1. + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + signatures: + description: + - Signatures holds all signatures of the image. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if the + image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This is + a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if empty + defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is a part + of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be a product + name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain at + least 64 lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_list.py b/library/k8s_v1_image_list.py new file mode 100644 index 00000000..bd73aa38 --- /dev/null +++ b/library/k8s_v1_image_list.py @@ -0,0 +1,634 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_list +short_description: Kubernetes ImageList +description: +- Retrieve a list of images. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of images + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if + the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This + is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if + empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is + a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be + a product name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain + at least 64 lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_signature.py b/library/k8s_v1_image_signature.py new file mode 100644 index 00000000..9b8b715d --- /dev/null +++ b/library/k8s_v1_image_signature.py @@ -0,0 +1,424 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_signature +short_description: Kubernetes ImageSignature +description: +- Manage the lifecycle of a image_signature object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + conditions: + description: + - Conditions represent the latest available observations of a signature's current + state. + type: list + content: + description: + - "Required: An opaque binary string which is an image's signature." + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + image_identity: + description: + - A human readable string representing image's identity. It could be a product + name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + issued_by_common_name: + description: + - Common name (e.g. openshift-signing-service). + aliases: + - common_name + issued_by_organization: + description: + - Organization name. + aliases: + - organization + issued_to_common_name: + description: + - Common name (e.g. openshift-signing-service). + aliases: + - common_name + issued_to_organization: + description: + - Organization name. + aliases: + - organization + issued_to_public_key_id: + description: + - If present, it is a human readable key id of public key belonging to the subject + used to verify image signature. It should contain at least 64 lowest bits of + public key's fingerprint (e.g. 0x685ebe62bf278440). + aliases: + - public_key_id + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + signed_claims: + description: + - Contains claims from the signature. + type: dict + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + type: + description: + - 'Required: Describes a type of stored blob.' + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_signature: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's current + state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be a product + name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging to the + subject used to verify image signature. It should contain at least 64 + lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_signature', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream.py b/library/k8s_v1_image_stream.py new file mode 100644 index 00000000..f630a9eb --- /dev/null +++ b/library/k8s_v1_image_stream.py @@ -0,0 +1,495 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream +short_description: Kubernetes ImageStream +description: +- Manage the lifecycle of a image_stream object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_docker_image_repository: + description: + - DockerImageRepository is optional, if specified this stream is backed by a Docker + repository on this server + aliases: + - docker_image_repository + spec_tags: + description: + - Tags map arbitrary string values to specific image locators + aliases: + - tags + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec describes the desired state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository is optional, if specified this stream is backed + by a Docker repository on this server + type: str + tags: + description: + - Tags map arbitrary string values to specific image locators + type: list + contains: + _from: + description: + - From is a reference to an image stream tag or image stream this tag + should track + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + annotations: + description: + - Annotations associated with images using this tag + type: complex + contains: str, str + generation: + description: + - Generation is the image stream generation that updated this tag - + setting it to 0 is an indication that the generation must be updated. + Legacy clients will send this as nil, which means the client doesn't + know or care. + type: int + import_policy: + description: + - Import is information that controls how images may be imported by + the server. + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically + checked to ensure it is up to date, and imported + type: bool + name: + description: + - Name of the tag + type: str + reference: + description: + - Reference states if the tag will be imported. Default value is false, + which means the tag will be imported. + type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config triggers + or new builds. The default value is `Source`, indicating the original + location of the image should be used (if imported). The user may + also specify `Local`, indicating that the pull spec should point + to the integrated Docker registry and leverage the registry's + ability to proxy the pull to an upstream registry. `Local` allows + the credentials used to pull this image to be managed from the + image stream's namespace, so others on the platform can access + a remote image but have no access to the remote secret. It also + allows the image layers to be mirrored into the local registry + which the images can still be pulled even if the upstream registry + is unavailable. + type: str + status: + description: + - Status describes the current state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository represents the effective location this stream may + be accessed at. May be empty until the server determines where the repository + is located + type: str + tags: + description: + - Tags are a historical record of images associated with each tag. The first + entry in the TagEvent array is the currently tagged image. + type: list + contains: + conditions: + description: + - Conditions is an array of conditions that apply to the tag event list. + type: list + contains: + generation: + description: + - Generation is the spec tag generation that this status corresponds + to + type: int + last_transition_time: + description: + - LastTransitionTIme is the time the condition transitioned from + one status to another. + type: complex + contains: {} + message: + description: + - Message is a human readable description of the details about last + transition, complementing reason. + type: str + reason: + description: + - Reason is a brief machine readable explanation for the condition's + last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of tag event condition, currently only ImportSuccess + type: str + items: + description: + - Standard object's metadata. + type: list + contains: + created: + description: + - Created holds the time the TagEvent was created + type: complex + contains: {} + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this + image + type: str + generation: + description: + - Generation is the spec tag generation that resulted in this tag + being updated + type: int + image: + description: + - Image is the image + type: str + tag: + description: + - Tag is the tag for which the history is recorded + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_image.py b/library/k8s_v1_image_stream_image.py new file mode 100644 index 00000000..25a9813b --- /dev/null +++ b/library/k8s_v1_image_stream_image.py @@ -0,0 +1,868 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_image +short_description: Kubernetes ImageStreamImage +description: +- Manage the lifecycle of a image_stream_image object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + image_api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + aliases: + - api_version + image_docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + aliases: + - docker_image_config + image_docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if the + image does not define that data. + aliases: + - docker_image_layers + type: list + image_docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + aliases: + - docker_image_manifest + image_docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This is a + part of manifest schema v2. + aliases: + - docker_image_manifest_media_type + image_docker_image_metadata_raw: + description: + - Raw is the underlying serialization of this object. + aliases: + - image_docker_metadata_raw + image_docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if empty + defaults to "1.0" + aliases: + - docker_image_metadata_version + image_docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + aliases: + - docker_image_reference + image_docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is a part + of manifest schema v1. + aliases: + - docker_image_signatures + type: list + image_kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + aliases: + - kind + image_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + image_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + image_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + image_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + image_signatures: + description: + - Signatures holds all signatures of the image. + aliases: + - signatures + type: list + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_image: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + image: + description: + - Image associated with the ImageStream and image name. + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if + the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This + is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if + empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is + a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be + a product name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain + at least 64 lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_image', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_import.py b/library/k8s_v1_image_stream_import.py new file mode 100644 index 00000000..39e33e55 --- /dev/null +++ b/library/k8s_v1_image_stream_import.py @@ -0,0 +1,2330 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_import +short_description: Kubernetes ImageStreamImport +description: +- Manage the lifecycle of a image_stream_import object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec__import: + description: + - Import indicates whether to perform an import - if so, the specified tags are + set on the spec and status of the image stream defined by the type meta. + aliases: + - _import + type: bool + spec_images: + description: + - Images are a list of individual images to import. + aliases: + - images + type: list + spec_repository__from_api_version: + description: + - API version of the referent. + aliases: + - repository__from_api_version + spec_repository__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - repository__from_field_path + spec_repository__from_kind: + description: + - Kind of the referent. + aliases: + - repository__from_kind + spec_repository__from_name: + description: + - Name of the referent. + aliases: + - repository__from_name + spec_repository__from_namespace: + description: + - Namespace of the referent. + aliases: + - repository__from_namespace + spec_repository__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - repository__from_resource_version + spec_repository__from_uid: + description: + - UID of the referent. + aliases: + - repository__from_uid + spec_repository_import_policy_insecure: + description: + - Insecure is true if the server may bypass certificate verification or connect + directly over HTTP during image import. + aliases: + - repository_import_policy_insecure + type: bool + spec_repository_import_policy_scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically checked + to ensure it is up to date, and imported + aliases: + - repository_import_policy_scheduled + type: bool + spec_repository_include_manifest: + description: + - IncludeManifest determines if the manifest for each image is returned in the + response + aliases: + - repository_include_manifest + type: bool + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_import: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is a description of the images that the user wishes to import + type: complex + contains: + _import: + description: + - Import indicates whether to perform an import - if so, the specified tags + are set on the spec and status of the image stream defined by the type + meta. + type: bool + images: + description: + - Images are a list of individual images to import. + type: list + contains: + _from: + description: + - From is the source of an image to import; only kind DockerImage is + allowed + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + import_policy: + description: + - ImportPolicy is the policy controlling how the image is imported + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically + checked to ensure it is up to date, and imported + type: bool + include_manifest: + description: + - IncludeManifest determines if the manifest for each image is returned + in the response + type: bool + to: + description: + - To is a tag in the current image stream to assign the imported image + to, if name is not specified the default tag from from.name will be + used + type: complex + contains: + name: + description: + - Name of the referent. + type: str + repository: + description: + - Repository is an optional import of an entire Docker image repository. + A maximum limit on the number of tags imported this way is imposed by + the server. + type: complex + contains: + _from: + description: + - From is the source for the image repository to import; only kind DockerImage + and a name of a Docker image repository is allowed + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + import_policy: + description: + - ImportPolicy is the policy controlling how the image is imported + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically + checked to ensure it is up to date, and imported + type: bool + include_manifest: + description: + - IncludeManifest determines if the manifest for each image is returned + in the response + type: bool + status: + description: + - Status is the the result of importing the image + type: complex + contains: + _import: + description: + - Import is the image stream that was successfully updated or created when + 'to' was set. + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Spec describes the desired state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository is optional, if specified this stream is + backed by a Docker repository on this server + type: str + tags: + description: + - Tags map arbitrary string values to specific image locators + type: list + contains: + _from: + description: + - From is a reference to an image stream tag or image stream + this tag should track + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field + access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way + of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + annotations: + description: + - Annotations associated with images using this tag + type: complex + contains: str, str + generation: + description: + - Generation is the image stream generation that updated this + tag - setting it to 0 is an indication that the generation + must be updated. Legacy clients will send this as nil, which + means the client doesn't know or care. + type: int + import_policy: + description: + - Import is information that controls how images may be imported + by the server. + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate + verification or connect directly over HTTP during image + import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should + be periodically checked to ensure it is up to date, and + imported + type: bool + name: + description: + - Name of the tag + type: str + reference: + description: + - Reference states if the tag will be imported. Default value + is false, which means the tag will be imported. + type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume + the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config + triggers or new builds. The default value is `Source`, + indicating the original location of the image should be + used (if imported). The user may also specify `Local`, + indicating that the pull spec should point to the integrated + Docker registry and leverage the registry's ability to + proxy the pull to an upstream registry. `Local` allows + the credentials used to pull this image to be managed + from the image stream's namespace, so others on the platform + can access a remote image but have no access to the remote + secret. It also allows the image layers to be mirrored + into the local registry which the images can still be + pulled even if the upstream registry is unavailable. + type: str + status: + description: + - Status describes the current state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository represents the effective location this stream + may be accessed at. May be empty until the server determines where + the repository is located + type: str + tags: + description: + - Tags are a historical record of images associated with each tag. + The first entry in the TagEvent array is the currently tagged + image. + type: list + contains: + conditions: + description: + - Conditions is an array of conditions that apply to the tag + event list. + type: list + contains: + generation: + description: + - Generation is the spec tag generation that this status + corresponds to + type: int + last_transition_time: + description: + - LastTransitionTIme is the time the condition transitioned + from one status to another. + type: complex + contains: {} + message: + description: + - Message is a human readable description of the details + about last transition, complementing reason. + type: str + reason: + description: + - Reason is a brief machine readable explanation for the + condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of tag event condition, currently only ImportSuccess + type: str + items: + description: + - Standard object's metadata. + type: list + contains: + created: + description: + - Created holds the time the TagEvent was created + type: complex + contains: {} + docker_image_reference: + description: + - DockerImageReference is the string that can be used to + pull this image + type: str + generation: + description: + - Generation is the spec tag generation that resulted in + this tag being updated + type: int + image: + description: + - Image is the image + type: str + tag: + description: + - Tag is the tag for which the history is recorded + type: str + images: + description: + - Images is set with the result of importing spec.images + type: list + contains: + image: + description: + - Image is the metadata of that image, if the image was located + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set + up the container. This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not + be set if the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. + This is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, + which if empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this + image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. + This is a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to + the latest internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of + a signature's current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It + could be a product name and version, or an image pull spec + (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing + certificate or key (a person or entity who signed the signing + certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing + certificate or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key + belonging to the subject used to verify image signature. + It should contain at least 64 lowest bits of public key's + fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store + and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere + right now and apiserver is going to ignore it if set in + create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed + to be set in happens-before order across separate operations. + Clients may not set this value. It is represented in RFC3339 + form and is in UTC. Populated by the system. Read-only. + Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only + set when deletionTimestamp is also set. May only be shortened. + Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and + is not directly settable by a client. The resource is + expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this + field. Once set, this value may not be unset or be set + further into the future, although it may be shortened + or the resource may be deleted prior to this time. For + example, a user may request that a pod is deleted in 30 + seconds. The Kubelet will react by sending a graceful + termination signal to the containers in the pod. After + that 30 seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, remove + the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until + an administrator or automated process can determine the + resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the + system when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only + be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not + been provided. If this field is used, the name returned + to the client will be different than the name passed. + This value will also be combined with a unique suffix. + The provided value has the same validation rules as the + Name field, and may be truncated by the length of the + suffix required to make the value unique on the server. + If this field is specified and the generated name exists, + the server will NOT return a 409 - instead, it will either + return 201 Created or 500 with Reason ServerTimeout indicating + a unique name could not be found in the time allotted, + and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if + Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when + creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all + objects are required to be scoped to a namespace - the + value of this field for those objects will be empty. Must + be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage + collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be + more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of + this object that can be used by clients to determine when + objects have changed. May be used for optimistic concurrency, + change detection, and the watch operation on a resource + or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of + resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful + creation of a resource and is not allowed to change on + PUT operations. Populated by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + status: + description: + - Status is the status of the image import, including errors encountered + while retrieving the image + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + code: + description: + - Suggested HTTP return code for this status, 0 if not set. + type: int + details: + description: + - Extended data associated with the reason. Each reason may define + its own extended details. This field is optional and the data + returned is not guaranteed to conform to any schema except that + defined by the reason type. + type: complex + contains: + causes: + description: + - The Causes array includes more details associated with the + StatusReason failure. Not all StatusReasons may provide detailed + causes. + type: list + contains: + field: + description: + - 'The field of the resource that has caused this error, + as named by its JSON serialization. May include dot and + postfix notation for nested attributes. Arrays are zero-indexed. + Fields may appear more than once in an array of causes + due to fields having multiple errors. Optional. Examples: + "name" - the field "name" on the current resource "items[0].name" + - the field "name" on the first array entry in "items"' + type: str + message: + description: + - A human-readable description of the cause of the error. + This field may be presented as-is to a reader. + type: str + reason: + description: + - A machine-readable description of the cause of the error. + If this value is empty there is no information available. + type: str + group: + description: + - The group attribute of the resource associated with the status + StatusReason. + type: str + kind: + description: + - The kind attribute of the resource associated with the status + StatusReason. On some operations may differ from the requested + resource Kind. + type: str + name: + description: + - The name attribute of the resource associated with the status + StatusReason (when there is a single name which can be described). + type: str + retry_after_seconds: + description: + - If specified, the time in seconds before the operation should + be retried. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + message: + description: + - A human-readable description of the status of this operation. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this + object that can be used by clients to determine when objects + have changed. Value must be treated as opaque by clients and + passed unmodified back to the server. Populated by the system. + Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + reason: + description: + - A machine-readable description of why this operation is in the + "Failure" status. If this value is empty there is no information + available. A Reason clarifies an HTTP status code but does not + override it. + type: str + status: + description: + - 'Status of the operation. One of: "Success" or "Failure".' + type: str + tag: + description: + - Tag is the tag this image was located under, if any + type: str + repository: + description: + - Repository is set if spec.repository was set to the outcome of the import + type: complex + contains: + additional_tags: + description: + - AdditionalTags are tags that exist in the repository but were not + imported because a maximum limit of automatic imports was applied. + type: list + contains: str + images: + description: + - Images is a list of images successfully retrieved by the import of + the repository. + type: list + contains: + image: + description: + - Image is the metadata of that image, if the image was located + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to + the latest internal value, and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to + set up the container. This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May + not be set if the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying + store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. + This is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, + which if empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull + this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. + This is a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store + and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere + right now and apiserver is going to ignore it if set in + create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed + to be set in happens-before order across separate operations. + Clients may not set this value. It is represented in RFC3339 + form and is in UTC. Populated by the system. Read-only. + Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only + set when deletionTimestamp is also set. May only be shortened. + Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and + is not directly settable by a client. The resource is + expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this + field. Once set, this value may not be unset or be set + further into the future, although it may be shortened + or the resource may be deleted prior to this time. For + example, a user may request that a pod is deleted in 30 + seconds. The Kubelet will react by sending a graceful + termination signal to the containers in the pod. After + that 30 seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, remove + the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until + an administrator or automated process can determine the + resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the + system when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only + be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not + been provided. If this field is used, the name returned + to the client will be different than the name passed. + This value will also be combined with a unique suffix. + The provided value has the same validation rules as the + Name field, and may be truncated by the length of the + suffix required to make the value unique on the server. + If this field is specified and the generated name exists, + the server will NOT return a 409 - instead, it will either + return 201 Created or 500 with Reason ServerTimeout indicating + a unique name could not be found in the time allotted, + and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if + Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when + creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all + objects are required to be scoped to a namespace - the + value of this field for those objects will be empty. Must + be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage + collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be + more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of + this object that can be used by clients to determine when + objects have changed. May be used for optimistic concurrency, + change detection, and the watch operation on a resource + or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of + resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful + creation of a resource and is not allowed to change on + PUT operations. Populated by the system. Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas + to the latest internal value, and may reject unrecognized + values. + type: str + conditions: + description: + - Conditions represent the latest available observations + of a signature's current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to + another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last + transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's\ + \ signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. + It could be a product name and version, or an image pull + spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of + signing certificate or key (a person or entity who signed + the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of + signing certificate or key (a person or entity who signed + the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public + key belonging to the subject used to verify image + signature. It should contain at least 64 lowest bits + of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource + this object represents. Servers may infer this from the + endpoint the client submits requests to. Cannot be updated. + In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored + with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. + This is used to distinguish resources with same name + and namespace in different clusters. This field is + not set anywhere right now and apiserver is going + to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the + server time when this object was created. It is not + guaranteed to be set in happens-before order across + separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated + by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. + Only set when deletionTimestamp is also set. May only + be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by + the server when a graceful deletion is requested by + the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by + name) after the time in this field. Once set, this + value may not be unset or be set further into the + future, although it may be shortened or the resource + may be deleted prior to this time. For example, a + user may request that a pod is deleted in 30 seconds. + The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 + seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network + partitions, this object may still exist after this + timestamp, until an administrator or automated process + can determine the resource is fully terminated. If + not set, graceful deletion of the object has not been + requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the + registry. Each entry is an identifier for the responsible + component that will remove the entry from the list. + If the deletionTimestamp of the object is non-nil, + entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has + not been provided. If this field is used, the name + returned to the client will be different than the + name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. If this field is specified and the + generated name exists, the server will NOT return + a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique + name could not be found in the time allotted, and + the client should retry (optionally after the time + indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to + organize and categorize (scope and select) objects. + May match selectors of replication controllers and + services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required + when creating resources, although some resources may + allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for + creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must + be unique. An empty namespace is equivalent to the + "default" namespace, but "default" is the canonical + representation. Not all objects are required to be + scoped to a namespace - the value of this field for + those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be + garbage collected. If this object is managed by a + controller, then an entry in this list will point + to this controller, with the controller field set + to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing + controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version + of this object that can be used by clients to determine + when objects have changed. May be used for optimistic + concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back + to the server. They may only be valid for a particular + resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this + object. It is typically generated by the server on + successful creation of a resource and is not allowed + to change on PUT operations. Populated by the system. + Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + status: + description: + - Status is the status of the image import, including errors encountered + while retrieving the image + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to + the latest internal value, and may reject unrecognized values. + type: str + code: + description: + - Suggested HTTP return code for this status, 0 if not set. + type: int + details: + description: + - Extended data associated with the reason. Each reason may + define its own extended details. This field is optional and + the data returned is not guaranteed to conform to any schema + except that defined by the reason type. + type: complex + contains: + causes: + description: + - The Causes array includes more details associated with + the StatusReason failure. Not all StatusReasons may provide + detailed causes. + type: list + contains: + field: + description: + - 'The field of the resource that has caused this error, + as named by its JSON serialization. May include dot + and postfix notation for nested attributes. Arrays + are zero-indexed. Fields may appear more than once + in an array of causes due to fields having multiple + errors. Optional. Examples: "name" - the field "name" + on the current resource "items[0].name" - the field + "name" on the first array entry in "items"' + type: str + message: + description: + - A human-readable description of the cause of the error. + This field may be presented as-is to a reader. + type: str + reason: + description: + - A machine-readable description of the cause of the + error. If this value is empty there is no information + available. + type: str + group: + description: + - The group attribute of the resource associated with the + status StatusReason. + type: str + kind: + description: + - The kind attribute of the resource associated with the + status StatusReason. On some operations may differ from + the requested resource Kind. + type: str + name: + description: + - The name attribute of the resource associated with the + status StatusReason (when there is a single name which + can be described). + type: str + retry_after_seconds: + description: + - If specified, the time in seconds before the operation + should be retried. + type: int + kind: + description: + - Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + type: str + message: + description: + - A human-readable description of the status of this operation. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of + this object that can be used by clients to determine when + objects have changed. Value must be treated as opaque + by clients and passed unmodified back to the server. Populated + by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + reason: + description: + - A machine-readable description of why this operation is in + the "Failure" status. If this value is empty there is no information + available. A Reason clarifies an HTTP status code but does + not override it. + type: str + status: + description: + - 'Status of the operation. One of: "Success" or "Failure".' + type: str + tag: + description: + - Tag is the tag this image was located under, if any + type: str + status: + description: + - Status reflects whether any failure occurred during import + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + code: + description: + - Suggested HTTP return code for this status, 0 if not set. + type: int + details: + description: + - Extended data associated with the reason. Each reason may define + its own extended details. This field is optional and the data + returned is not guaranteed to conform to any schema except that + defined by the reason type. + type: complex + contains: + causes: + description: + - The Causes array includes more details associated with the + StatusReason failure. Not all StatusReasons may provide detailed + causes. + type: list + contains: + field: + description: + - 'The field of the resource that has caused this error, + as named by its JSON serialization. May include dot and + postfix notation for nested attributes. Arrays are zero-indexed. + Fields may appear more than once in an array of causes + due to fields having multiple errors. Optional. Examples: + "name" - the field "name" on the current resource "items[0].name" + - the field "name" on the first array entry in "items"' + type: str + message: + description: + - A human-readable description of the cause of the error. + This field may be presented as-is to a reader. + type: str + reason: + description: + - A machine-readable description of the cause of the error. + If this value is empty there is no information available. + type: str + group: + description: + - The group attribute of the resource associated with the status + StatusReason. + type: str + kind: + description: + - The kind attribute of the resource associated with the status + StatusReason. On some operations may differ from the requested + resource Kind. + type: str + name: + description: + - The name attribute of the resource associated with the status + StatusReason (when there is a single name which can be described). + type: str + retry_after_seconds: + description: + - If specified, the time in seconds before the operation should + be retried. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + message: + description: + - A human-readable description of the status of this operation. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this + object that can be used by clients to determine when objects + have changed. Value must be treated as opaque by clients and + passed unmodified back to the server. Populated by the system. + Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + reason: + description: + - A machine-readable description of why this operation is in the + "Failure" status. If this value is empty there is no information + available. A Reason clarifies an HTTP status code but does not + override it. + type: str + status: + description: + - 'Status of the operation. One of: "Success" or "Failure".' + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_import', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_list.py b/library/k8s_v1_image_stream_list.py new file mode 100644 index 00000000..5de53f0a --- /dev/null +++ b/library/k8s_v1_image_stream_list.py @@ -0,0 +1,508 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_list +short_description: Kubernetes ImageStreamList +description: +- Retrieve a list of image_streams. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of imageStreams + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec describes the desired state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository is optional, if specified this stream is backed + by a Docker repository on this server + type: str + tags: + description: + - Tags map arbitrary string values to specific image locators + type: list + contains: + _from: + description: + - From is a reference to an image stream tag or image stream this + tag should track + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + annotations: + description: + - Annotations associated with images using this tag + type: complex + contains: str, str + generation: + description: + - Generation is the image stream generation that updated this tag + - setting it to 0 is an indication that the generation must be + updated. Legacy clients will send this as nil, which means the + client doesn't know or care. + type: int + import_policy: + description: + - Import is information that controls how images may be imported + by the server. + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be + periodically checked to ensure it is up to date, and imported + type: bool + name: + description: + - Name of the tag + type: str + reference: + description: + - Reference states if the tag will be imported. Default value is + false, which means the tag will be imported. + type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the + image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config triggers + or new builds. The default value is `Source`, indicating the + original location of the image should be used (if imported). + The user may also specify `Local`, indicating that the pull + spec should point to the integrated Docker registry and leverage + the registry's ability to proxy the pull to an upstream registry. + `Local` allows the credentials used to pull this image to + be managed from the image stream's namespace, so others on + the platform can access a remote image but have no access + to the remote secret. It also allows the image layers to be + mirrored into the local registry which the images can still + be pulled even if the upstream registry is unavailable. + type: str + status: + description: + - Status describes the current state of this stream + type: complex + contains: + docker_image_repository: + description: + - DockerImageRepository represents the effective location this stream + may be accessed at. May be empty until the server determines where + the repository is located + type: str + tags: + description: + - Tags are a historical record of images associated with each tag. The + first entry in the TagEvent array is the currently tagged image. + type: list + contains: + conditions: + description: + - Conditions is an array of conditions that apply to the tag event + list. + type: list + contains: + generation: + description: + - Generation is the spec tag generation that this status corresponds + to + type: int + last_transition_time: + description: + - LastTransitionTIme is the time the condition transitioned + from one status to another. + type: complex + contains: {} + message: + description: + - Message is a human readable description of the details about + last transition, complementing reason. + type: str + reason: + description: + - Reason is a brief machine readable explanation for the condition's + last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of tag event condition, currently only ImportSuccess + type: str + items: + description: + - Standard object's metadata. + type: list + contains: + created: + description: + - Created holds the time the TagEvent was created + type: complex + contains: {} + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull + this image + type: str + generation: + description: + - Generation is the spec tag generation that resulted in this + tag being updated + type: int + image: + description: + - Image is the image + type: str + tag: + description: + - Tag is the tag for which the history is recorded + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_mapping.py b/library/k8s_v1_image_stream_mapping.py new file mode 100644 index 00000000..31629dcd --- /dev/null +++ b/library/k8s_v1_image_stream_mapping.py @@ -0,0 +1,875 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_mapping +short_description: Kubernetes ImageStreamMapping +description: +- Manage the lifecycle of a image_stream_mapping object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + image_api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + aliases: + - api_version + image_docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + aliases: + - docker_image_config + image_docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if the + image does not define that data. + aliases: + - docker_image_layers + type: list + image_docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + aliases: + - docker_image_manifest + image_docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This is a + part of manifest schema v2. + aliases: + - docker_image_manifest_media_type + image_docker_image_metadata_raw: + description: + - Raw is the underlying serialization of this object. + aliases: + - image_docker_metadata_raw + image_docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if empty + defaults to "1.0" + aliases: + - docker_image_metadata_version + image_docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + aliases: + - docker_image_reference + image_docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is a part + of manifest schema v1. + aliases: + - docker_image_signatures + type: list + image_kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + aliases: + - kind + image_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + image_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + image_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + image_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + image_signatures: + description: + - Signatures holds all signatures of the image. + aliases: + - signatures + type: list + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + tag: + description: + - Tag is a string value this image can be located with inside the stream. + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_mapping: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + image: + description: + - Image is a Docker image. + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if + the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This + is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if + empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is + a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be + a product name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain + at least 64 lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + tag: + description: + - Tag is a string value this image can be located with inside the stream. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_mapping', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_tag.py b/library/k8s_v1_image_stream_tag.py new file mode 100644 index 00000000..46b39bc3 --- /dev/null +++ b/library/k8s_v1_image_stream_tag.py @@ -0,0 +1,1129 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_tag +short_description: Kubernetes ImageStreamTag +description: +- Manage the lifecycle of a image_stream_tag object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + conditions: + description: + - Conditions is an array of conditions that apply to the image stream tag. + type: list + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + generation: + description: + - Generation is the current generation of the tagged image - if tag is provided + and this value is not equal to the tag generation, a user has requested an import + that has not completed, or Conditions will be filled out indicating any error. + type: int + host: + description: + - Provide a URL for acessing the Kubernetes API. + image_api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + aliases: + - api_version + image_docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + aliases: + - docker_image_config + image_docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if the + image does not define that data. + aliases: + - docker_image_layers + type: list + image_docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + aliases: + - docker_image_manifest + image_docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This is a + part of manifest schema v2. + aliases: + - docker_image_manifest_media_type + image_docker_image_metadata_raw: + description: + - Raw is the underlying serialization of this object. + aliases: + - image_docker_metadata_raw + image_docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if empty + defaults to "1.0" + aliases: + - docker_image_metadata_version + image_docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + aliases: + - docker_image_reference + image_docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is a part + of manifest schema v1. + aliases: + - docker_image_signatures + type: list + image_kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + aliases: + - kind + image_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + image_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + image_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + image_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + image_signatures: + description: + - Signatures holds all signatures of the image. + aliases: + - signatures + type: list + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + tag__from_api_version: + description: + - API version of the referent. + aliases: + - api_version + tag__from_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + tag__from_kind: + description: + - Kind of the referent. + aliases: + - kind + tag__from_name: + description: + - Name of the referent. + aliases: + - name + tag__from_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + tag__from_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + tag__from_uid: + description: + - UID of the referent. + aliases: + - uid + tag_annotations: + description: + - Annotations associated with images using this tag + aliases: + - annotations + type: dict + tag_generation: + description: + - Generation is the image stream generation that updated this tag - setting it + to 0 is an indication that the generation must be updated. Legacy clients will + send this as nil, which means the client doesn't know or care. + aliases: + - generation + type: int + tag_import_policy_insecure: + description: + - Insecure is true if the server may bypass certificate verification or connect + directly over HTTP during image import. + aliases: + - insecure + type: bool + tag_import_policy_scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically checked + to ensure it is up to date, and imported + aliases: + - scheduled + type: bool + tag_name: + description: + - Name of the tag + aliases: + - name + tag_reference: + description: + - Reference states if the tag will be imported. Default value is false, which + means the tag will be imported. + aliases: + - reference + type: bool + tag_reference_policy_type: + description: + - Type determines how the image pull spec should be transformed when the image + stream tag is used in deployment config triggers or new builds. The default + value is `Source`, indicating the original location of the image should be used + (if imported). The user may also specify `Local`, indicating that the pull spec + should point to the integrated Docker registry and leverage the registry's ability + to proxy the pull to an upstream registry. `Local` allows the credentials used + to pull this image to be managed from the image stream's namespace, so others + on the platform can access a remote image but have no access to the remote secret. + It also allows the image layers to be mirrored into the local registry which + the images can still be pulled even if the upstream registry is unavailable. + aliases: + - type + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_tag: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + conditions: + description: + - Conditions is an array of conditions that apply to the image stream tag. + type: list + contains: + generation: + description: + - Generation is the spec tag generation that this status corresponds to + type: int + last_transition_time: + description: + - LastTransitionTIme is the time the condition transitioned from one status + to another. + type: complex + contains: {} + message: + description: + - Message is a human readable description of the details about last transition, + complementing reason. + type: str + reason: + description: + - Reason is a brief machine readable explanation for the condition's last + transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of tag event condition, currently only ImportSuccess + type: str + generation: + description: + - Generation is the current generation of the tagged image - if tag is provided + and this value is not equal to the tag generation, a user has requested an + import that has not completed, or Conditions will be filled out indicating + any error. + type: int + image: + description: + - Image associated with the ImageStream and tag. + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the container. + This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set if + the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. This + is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which if + empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This is + a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could be + a product name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing certificate + or key (a person or entity who signed the signing certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing certificate + or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain + at least 64 lowest bits of public key's fingerprint (e.g. 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + tag: + description: + - Tag is the spec tag associated with this image stream tag, and it may be null + if only pushes have occurred to this image stream. + type: complex + contains: + _from: + description: + - From is a reference to an image stream tag or image stream this tag should + track + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + annotations: + description: + - Annotations associated with images using this tag + type: complex + contains: str, str + generation: + description: + - Generation is the image stream generation that updated this tag - setting + it to 0 is an indication that the generation must be updated. Legacy clients + will send this as nil, which means the client doesn't know or care. + type: int + import_policy: + description: + - Import is information that controls how images may be imported by the + server. + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically + checked to ensure it is up to date, and imported + type: bool + name: + description: + - Name of the tag + type: str + reference: + description: + - Reference states if the tag will be imported. Default value is false, + which means the tag will be imported. + type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed when + the image stream tag is used in deployment config triggers or new + builds. The default value is `Source`, indicating the original location + of the image should be used (if imported). The user may also specify + `Local`, indicating that the pull spec should point to the integrated + Docker registry and leverage the registry's ability to proxy the pull + to an upstream registry. `Local` allows the credentials used to pull + this image to be managed from the image stream's namespace, so others + on the platform can access a remote image but have no access to the + remote secret. It also allows the image layers to be mirrored into + the local registry which the images can still be pulled even if the + upstream registry is unavailable. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_tag', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_image_stream_tag_list.py b/library/k8s_v1_image_stream_tag_list.py new file mode 100644 index 00000000..6f8c8cbc --- /dev/null +++ b/library/k8s_v1_image_stream_tag_list.py @@ -0,0 +1,969 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_image_stream_tag_list +short_description: Kubernetes ImageStreamTagList +description: +- Retrieve a list of image_stream_tags. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +image_stream_tag_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of image stream tags + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + conditions: + description: + - Conditions is an array of conditions that apply to the image stream tag. + type: list + contains: + generation: + description: + - Generation is the spec tag generation that this status corresponds + to + type: int + last_transition_time: + description: + - LastTransitionTIme is the time the condition transitioned from one + status to another. + type: complex + contains: {} + message: + description: + - Message is a human readable description of the details about last + transition, complementing reason. + type: str + reason: + description: + - Reason is a brief machine readable explanation for the condition's + last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of tag event condition, currently only ImportSuccess + type: str + generation: + description: + - Generation is the current generation of the tagged image - if tag is provided + and this value is not equal to the tag generation, a user has requested + an import that has not completed, or Conditions will be filled out indicating + any error. + type: int + image: + description: + - Image associated with the ImageStream and tag. + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + docker_image_config: + description: + - DockerImageConfig is a JSON blob that the runtime uses to set up the + container. This is a part of manifest schema v2. + type: str + docker_image_layers: + description: + - DockerImageLayers represents the layers in the image. May not be set + if the image does not define that data. + type: list + contains: + media_type: + description: + - MediaType of the referenced object. + type: str + name: + description: + - Name of the layer as defined by the underlying store. + type: str + size: + description: + - Size of the layer in bytes as defined by the underlying store. + type: int + docker_image_manifest: + description: + - DockerImageManifest is the raw JSON of the manifest + type: str + docker_image_manifest_media_type: + description: + - DockerImageManifestMediaType specifies the mediaType of manifest. + This is a part of manifest schema v2. + type: str + docker_image_metadata: + description: + - DockerImageMetadata contains metadata about this image + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + docker_image_metadata_version: + description: + - DockerImageMetadataVersion conveys the version of the object, which + if empty defaults to "1.0" + type: str + docker_image_reference: + description: + - DockerImageReference is the string that can be used to pull this image. + type: str + docker_image_signatures: + description: + - DockerImageSignatures provides the signatures as opaque blobs. This + is a part of manifest schema v1. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + signatures: + description: + - Signatures holds all signatures of the image. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + conditions: + description: + - Conditions represent the latest available observations of a signature's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of signature condition, Complete or Failed. + type: str + content: + description: + - "Required: An opaque binary string which is an image's signature." + type: str + created: + description: + - If specified, it is the time of signature's creation. + type: complex + contains: {} + image_identity: + description: + - A human readable string representing image's identity. It could + be a product name and version, or an image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). + type: str + issued_by: + description: + - If specified, it holds information about an issuer of signing + certificate or key (a person or entity who signed the signing + certificate or key). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + issued_to: + description: + - If specified, it holds information about a subject of signing + certificate or key (a person or entity who signed the image). + type: complex + contains: + common_name: + description: + - Common name (e.g. openshift-signing-service). + type: str + organization: + description: + - Organization name. + type: str + public_key_id: + description: + - If present, it is a human readable key id of public key belonging + to the subject used to verify image signature. It should contain + at least 64 lowest bits of public key's fingerprint (e.g. + 0x685ebe62bf278440). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + signed_claims: + description: + - Contains claims from the signature. + type: complex + contains: str, str + type: + description: + - 'Required: Describes a type of stored blob.' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + tag: + description: + - Tag is the spec tag associated with this image stream tag, and it may + be null if only pushes have occurred to this image stream. + type: complex + contains: + _from: + description: + - From is a reference to an image stream tag or image stream this tag + should track + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + annotations: + description: + - Annotations associated with images using this tag + type: complex + contains: str, str + generation: + description: + - Generation is the image stream generation that updated this tag - + setting it to 0 is an indication that the generation must be updated. + Legacy clients will send this as nil, which means the client doesn't + know or care. + type: int + import_policy: + description: + - Import is information that controls how images may be imported by + the server. + type: complex + contains: + insecure: + description: + - Insecure is true if the server may bypass certificate verification + or connect directly over HTTP during image import. + type: bool + scheduled: + description: + - Scheduled indicates to the server that this tag should be periodically + checked to ensure it is up to date, and imported + type: bool + name: + description: + - Name of the tag + type: str + reference: + description: + - Reference states if the tag will be imported. Default value is false, + which means the tag will be imported. + type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config triggers + or new builds. The default value is `Source`, indicating the original + location of the image should be used (if imported). The user may + also specify `Local`, indicating that the pull spec should point + to the integrated Docker registry and leverage the registry's + ability to proxy the pull to an upstream registry. `Local` allows + the credentials used to pull this image to be managed from the + image stream's namespace, so others on the platform can access + a remote image but have no access to the remote secret. It also + allows the image layers to be mirrored into the local registry + which the images can still be pulled even if the upstream registry + is unavailable. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('image_stream_tag_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_job.py b/library/k8s_v1_job.py new file mode 100644 index 00000000..673715c9 --- /dev/null +++ b/library/k8s_v1_job.py @@ -0,0 +1,2486 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_job +short_description: Kubernetes Job +description: +- Manage the lifecycle of a job object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may be active + before the system tries to terminate it; value must be positive integer + aliases: + - active_deadline_seconds + type: int + spec_completions: + description: + - Completions specifies the desired number of successfully finished pods the job + should be run with. Setting to nil means that the success of any pod signals + the success of all pods, and allows parallelism to have any positive value. + Setting to 1 means that parallelism is limited to 1 and the success of that + pod signals the success of the job. + aliases: + - completions + type: int + spec_manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` + unset unless you are certain what you are doing. When false or unset, the system + pick labels unique to this job and appends those labels to the pod template. + When true, the user is responsible for picking unique labels and specifying + the selector. Failure to pick a unique label may cause this and other jobs to + not function correctly. However, You may see `manualSelector=true` in jobs that + were created with the old `extensions/v1beta1` API. + aliases: + - manual_selector + type: bool + spec_parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should run + at any given time. The actual number of pods running in steady state will be + less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), + i.e. when the work left to do is less than max parallelism. + aliases: + - parallelism + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may + be active before the system tries to terminate it; value must be positive + integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished pods + the job should be run with. Setting to nil means that the success of any + pod signals the success of all pods, and allows parallelism to have any + positive value. Setting to 1 means that parallelism is limited to 1 and + the success of that pod signals the success of the job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. Leave + `manualSelector` unset unless you are certain what you are doing. When + false or unset, the system pick labels unique to this job and appends + those labels to the pod template. When true, the user is responsible for + picking unique labels and specifying the selector. Failure to pick a unique + label may cause this and other jobs to not function correctly. However, + You may see `manualSelector=true` in jobs that were created with the old + `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady state + will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. Normally, + the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created when + executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not guaranteed + to be set in happens-before order across separate operations. It is represented + in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job Manager. + It is not guaranteed to be set in happens-before order across separate + operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_job_list.py b/library/k8s_v1_job_list.py new file mode 100644 index 00000000..fdf2b122 --- /dev/null +++ b/library/k8s_v1_job_list.py @@ -0,0 +1,2306 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_job_list +short_description: Kubernetes JobList +description: +- Retrieve a list of jobs. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Job. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job + may be active before the system tries to terminate it; value must + be positive integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished + pods the job should be run with. Setting to nil means that the success + of any pod signals the success of all pods, and allows parallelism + to have any positive value. Setting to 1 means that parallelism is + limited to 1 and the success of that pod signals the success of the + job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. + Leave `manualSelector` unset unless you are certain what you are doing. + When false or unset, the system pick labels unique to this job and + appends those labels to the pod template. When true, the user is responsible + for picking unique labels and specifying the selector. Failure to + pick a unique label may cause this and other jobs to not function + correctly. However, You may see `manualSelector=true` in jobs that + were created with the old `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady + state will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max + parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. + Normally, the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + when executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not + guaranteed to be set in happens-before order across separate operations. + It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job + Manager. It is not guaranteed to be set in happens-before order across + separate operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_limit_range.py b/library/k8s_v1_limit_range.py new file mode 100644 index 00000000..f2ebabcb --- /dev/null +++ b/library/k8s_v1_limit_range.py @@ -0,0 +1,339 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_limit_range +short_description: Kubernetes LimitRange +description: +- Manage the lifecycle of a limit_range object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_limits: + description: + - Limits is the list of LimitRangeItem objects that are enforced. + aliases: + - limits + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +limit_range: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the limits enforced. + type: complex + contains: + limits: + description: + - Limits is the list of LimitRangeItem objects that are enforced. + type: list + contains: + default: + description: + - Default resource requirement limit value by resource name if resource + limit is omitted. + type: complex + contains: str, ResourceQuantity + default_request: + description: + - DefaultRequest is the default resource requirement request value by + resource name if resource request is omitted. + type: complex + contains: str, ResourceQuantity + max: + description: + - Max usage constraints on this kind by resource name. + type: complex + contains: str, ResourceQuantity + max_limit_request_ratio: + description: + - MaxLimitRequestRatio if specified, the named resource must have a + request and limit that are both non-zero where limit divided by request + is less than or equal to the enumerated value; this represents the + max burst for the named resource. + type: complex + contains: str, ResourceQuantity + min: + description: + - Min usage constraints on this kind by resource name. + type: complex + contains: str, ResourceQuantity + type: + description: + - Type of resource that this limit applies to. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('limit_range', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_limit_range_list.py b/library/k8s_v1_limit_range_list.py new file mode 100644 index 00000000..399b4e47 --- /dev/null +++ b/library/k8s_v1_limit_range_list.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_limit_range_list +short_description: Kubernetes LimitRangeList +description: +- Retrieve a list of limit_ranges. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +limit_range_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of LimitRange objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the limits enforced. + type: complex + contains: + limits: + description: + - Limits is the list of LimitRangeItem objects that are enforced. + type: list + contains: + default: + description: + - Default resource requirement limit value by resource name if resource + limit is omitted. + type: complex + contains: str, ResourceQuantity + default_request: + description: + - DefaultRequest is the default resource requirement request value + by resource name if resource request is omitted. + type: complex + contains: str, ResourceQuantity + max: + description: + - Max usage constraints on this kind by resource name. + type: complex + contains: str, ResourceQuantity + max_limit_request_ratio: + description: + - MaxLimitRequestRatio if specified, the named resource must have + a request and limit that are both non-zero where limit divided + by request is less than or equal to the enumerated value; this + represents the max burst for the named resource. + type: complex + contains: str, ResourceQuantity + min: + description: + - Min usage constraints on this kind by resource name. + type: complex + contains: str, ResourceQuantity + type: + description: + - Type of resource that this limit applies to. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('limit_range_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_namespace.py b/library/k8s_v1_namespace.py new file mode 100644 index 00000000..0bba39a0 --- /dev/null +++ b/library/k8s_v1_namespace.py @@ -0,0 +1,367 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_namespace +short_description: Kubernetes Namespace +description: +- Manage the lifecycle of a namespace object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently remove + object from storage. + aliases: + - finalizers + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +- name: Create a namespace + k8s_v1_namespace: + name: k8s-project + state: present + +- name: Add labels and annotations + k8s_v1_namespace: + name: k8s-project + state: present + labels: + app_env: production + app_class: '3' + annotations: + domain: namespace.com.acmecorp + +- name: Update labels and annotations + k8s_v1_namespace: + name: k8s-project + state: present + labels: + app_env: production + app_class: '4' + app_group: '2' + annotations: + domain: namespace.app.com.acmecorp + monitoring_group: '1' + +- name: Create a namespace + k8s_v1_namespace: + name: search-project + state: present + labels: + app: web + level: '1' + annotations: + company: acme.com + +- name: Replace namespace + k8s_v1_namespace: + name: search-project + state: replaced + labels: + app: web_app + level: '3' + annotations: + company: acme.com + +- name: Remove namespace + k8s_v1_namespace: + name: search-project + state: absent +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +namespace: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the behavior of the Namespace. + type: complex + contains: + finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently + remove object from storage. + type: list + contains: str + status: + description: + - Status describes the current status of a Namespace. + type: complex + contains: + phase: + description: + - Phase is the current lifecycle phase of the namespace. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('namespace', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_namespace_list.py b/library/k8s_v1_namespace_list.py new file mode 100644 index 00000000..2dd2b935 --- /dev/null +++ b/library/k8s_v1_namespace_list.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_namespace_list +short_description: Kubernetes NamespaceList +description: +- Retrieve a list of namespaces. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +namespace_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Namespace objects in the list. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the behavior of the Namespace. + type: complex + contains: + finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently + remove object from storage. + type: list + contains: str + status: + description: + - Status describes the current status of a Namespace. + type: complex + contains: + phase: + description: + - Phase is the current lifecycle phase of the namespace. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('namespace_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_net_namespace.py b/library/k8s_v1_net_namespace.py new file mode 100644 index 00000000..fdc350dc --- /dev/null +++ b/library/k8s_v1_net_namespace.py @@ -0,0 +1,309 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_net_namespace +short_description: Kubernetes NetNamespace +description: +- Manage the lifecycle of a net_namespace object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + netid: + description: + - NetID is the network identifier of the network namespace assigned to each overlay + network packet. This can be manipulated with the "oadm pod-network" commands. + type: int + netname: + description: + - NetName is the name of the network namespace. (This is the same as the object's + name, but both fields must be set.) + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +net_namespace: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + netid: + description: + - NetID is the network identifier of the network namespace assigned to each + overlay network packet. This can be manipulated with the "oadm pod-network" + commands. + type: int + netname: + description: + - NetName is the name of the network namespace. (This is the same as the object's + name, but both fields must be set.) + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('net_namespace', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_net_namespace_list.py b/library/k8s_v1_net_namespace_list.py new file mode 100644 index 00000000..68941094 --- /dev/null +++ b/library/k8s_v1_net_namespace_list.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_net_namespace_list +short_description: Kubernetes NetNamespaceList +description: +- Retrieve a list of net_namespaces. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +net_namespace_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of net namespaces + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + netid: + description: + - NetID is the network identifier of the network namespace assigned to each + overlay network packet. This can be manipulated with the "oadm pod-network" + commands. + type: int + netname: + description: + - NetName is the name of the network namespace. (This is the same as the + object's name, but both fields must be set.) + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('net_namespace_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_node.py b/library/k8s_v1_node.py new file mode 100644 index 00000000..02cb6059 --- /dev/null +++ b/library/k8s_v1_node.py @@ -0,0 +1,497 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_node +short_description: Kubernetes Node +description: +- Manage the lifecycle of a node object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_external_id: + description: + - External ID of the node assigned by some machine database (e.g. a cloud provider). + Deprecated. + aliases: + - external_id + spec_pod_cidr: + description: + - PodCIDR represents the pod IP range assigned to the node. + aliases: + - pod_cidr + spec_provider_id: + description: + - 'ID of the node assigned by the cloud provider in the format: ://' + aliases: + - provider_id + spec_unschedulable: + description: + - Unschedulable controls node schedulability of new pods. By default, node is + schedulable. + aliases: + - unschedulable + type: bool + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +node: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the behavior of a node. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + external_id: + description: + - External ID of the node assigned by some machine database (e.g. a cloud + provider). Deprecated. + type: str + pod_cidr: + description: + - PodCIDR represents the pod IP range assigned to the node. + type: str + provider_id: + description: + - 'ID of the node assigned by the cloud provider in the format: ://' + type: str + unschedulable: + description: + - Unschedulable controls node schedulability of new pods. By default, node + is schedulable. + type: bool + status: + description: + - Most recently observed status of the node. Populated by the system. Read-only. + type: complex + contains: + addresses: + description: + - List of addresses reachable to the node. Queried from cloud provider, + if available. + type: list + contains: + address: + description: + - The node address. + type: str + type: + description: + - Node address type, one of Hostname, ExternalIP or InternalIP. + type: str + allocatable: + description: + - Allocatable represents the resources of a node that are available for + scheduling. Defaults to Capacity. + type: complex + contains: str, ResourceQuantity + capacity: + description: + - Capacity represents the total resources of a node. + type: complex + contains: str, ResourceQuantity + conditions: + description: + - Conditions is an array of current observed node conditions. + type: list + contains: + last_heartbeat_time: + description: + - Last time we got an update on a given condition. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of node condition. + type: str + daemon_endpoints: + description: + - Endpoints of daemons running on the Node. + type: complex + contains: + kubelet_endpoint: + description: + - Endpoint on which Kubelet is listening. + type: complex + contains: + port: + description: + - Port number of the given endpoint. + type: int + images: + description: + - List of container images on this node + type: list + contains: + names: + description: + - Names by which this image is known. e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", + "dockerhub.io/google_containers/hyperkube:v1.0.7"] + type: list + contains: str + size_bytes: + description: + - The size of the image in bytes. + type: int + node_info: + description: + - Set of ids/uuids to uniquely identify the node. + type: complex + contains: + architecture: + description: + - The Architecture reported by the node + type: str + boot_id: + description: + - Boot ID reported by the node. + type: str + container_runtime_version: + description: + - ContainerRuntime Version reported by the node through runtime remote + API (e.g. docker://1.5.0). + type: str + kernel_version: + description: + - Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). + type: str + kube_proxy_version: + description: + - KubeProxy Version reported by the node. + type: str + kubelet_version: + description: + - Kubelet Version reported by the node. + type: str + machine_id: + description: + - 'MachineID reported by the node. For unique machine identification + in the cluster this field is prefered. Learn more from man(5) machine-id: + http://man7.org/linux/man-pages/man5/machine-id.5.html' + type: str + operating_system: + description: + - The Operating System reported by the node + type: str + os_image: + description: + - OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux + 7 (wheezy)). + type: str + system_uuid: + description: + - SystemUUID reported by the node. For unique machine identification + MachineID is prefered. This field is specific to Red Hat hosts + type: str + phase: + description: + - NodePhase is the recently observed lifecycle phase of the node. + type: str + volumes_attached: + description: + - List of volumes that are attached to the node. + type: list + contains: + device_path: + description: + - DevicePath represents the device path where the volume should be available + type: str + name: + description: + - Name of the attached volume + type: str + volumes_in_use: + description: + - List of attachable volumes in use (mounted) by the node. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('node', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_node_list.py b/library/k8s_v1_node_list.py new file mode 100644 index 00000000..09fb3b69 --- /dev/null +++ b/library/k8s_v1_node_list.py @@ -0,0 +1,496 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_node_list +short_description: Kubernetes NodeList +description: +- Retrieve a list of nodes. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +node_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of nodes + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the behavior of a node. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + external_id: + description: + - External ID of the node assigned by some machine database (e.g. a + cloud provider). Deprecated. + type: str + pod_cidr: + description: + - PodCIDR represents the pod IP range assigned to the node. + type: str + provider_id: + description: + - 'ID of the node assigned by the cloud provider in the format: ://' + type: str + unschedulable: + description: + - Unschedulable controls node schedulability of new pods. By default, + node is schedulable. + type: bool + status: + description: + - Most recently observed status of the node. Populated by the system. Read-only. + type: complex + contains: + addresses: + description: + - List of addresses reachable to the node. Queried from cloud provider, + if available. + type: list + contains: + address: + description: + - The node address. + type: str + type: + description: + - Node address type, one of Hostname, ExternalIP or InternalIP. + type: str + allocatable: + description: + - Allocatable represents the resources of a node that are available + for scheduling. Defaults to Capacity. + type: complex + contains: str, ResourceQuantity + capacity: + description: + - Capacity represents the total resources of a node. + type: complex + contains: str, ResourceQuantity + conditions: + description: + - Conditions is an array of current observed node conditions. + type: list + contains: + last_heartbeat_time: + description: + - Last time we got an update on a given condition. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of node condition. + type: str + daemon_endpoints: + description: + - Endpoints of daemons running on the Node. + type: complex + contains: + kubelet_endpoint: + description: + - Endpoint on which Kubelet is listening. + type: complex + contains: + port: + description: + - Port number of the given endpoint. + type: int + images: + description: + - List of container images on this node + type: list + contains: + names: + description: + - Names by which this image is known. e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", + "dockerhub.io/google_containers/hyperkube:v1.0.7"] + type: list + contains: str + size_bytes: + description: + - The size of the image in bytes. + type: int + node_info: + description: + - Set of ids/uuids to uniquely identify the node. + type: complex + contains: + architecture: + description: + - The Architecture reported by the node + type: str + boot_id: + description: + - Boot ID reported by the node. + type: str + container_runtime_version: + description: + - ContainerRuntime Version reported by the node through runtime + remote API (e.g. docker://1.5.0). + type: str + kernel_version: + description: + - Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). + type: str + kube_proxy_version: + description: + - KubeProxy Version reported by the node. + type: str + kubelet_version: + description: + - Kubelet Version reported by the node. + type: str + machine_id: + description: + - 'MachineID reported by the node. For unique machine identification + in the cluster this field is prefered. Learn more from man(5) + machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html' + type: str + operating_system: + description: + - The Operating System reported by the node + type: str + os_image: + description: + - OS Image reported by the node from /etc/os-release (e.g. Debian + GNU/Linux 7 (wheezy)). + type: str + system_uuid: + description: + - SystemUUID reported by the node. For unique machine identification + MachineID is prefered. This field is specific to Red Hat hosts + type: str + phase: + description: + - NodePhase is the recently observed lifecycle phase of the node. + type: str + volumes_attached: + description: + - List of volumes that are attached to the node. + type: list + contains: + device_path: + description: + - DevicePath represents the device path where the volume should + be available + type: str + name: + description: + - Name of the attached volume + type: str + volumes_in_use: + description: + - List of attachable volumes in use (mounted) by the node. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('node_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_access_token.py b/library/k8s_v1_o_auth_access_token.py new file mode 100644 index 00000000..71e72558 --- /dev/null +++ b/library/k8s_v1_o_auth_access_token.py @@ -0,0 +1,348 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_access_token +short_description: Kubernetes OAuthAccessToken +description: +- Manage the lifecycle of a o_auth_access_token object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + authorize_token: + description: + - AuthorizeToken contains the token that authorized this token + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + client_name: + description: + - ClientName references the client that created this token. + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + refresh_token: + description: + - RefreshToken is the value by which this token can be renewed. Can be blank. + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + user_name: + description: + - UserName is the user name associated with this token + user_uid: + description: + - UserUID is the unique UID associated with this token + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_access_token: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + authorize_token: + description: + - AuthorizeToken contains the token that authorized this token + type: str + client_name: + description: + - ClientName references the client that created this token. + type: str + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + type: str + refresh_token: + description: + - RefreshToken is the value by which this token can be renewed. Can be blank. + type: str + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + contains: str + user_name: + description: + - UserName is the user name associated with this token + type: str + user_uid: + description: + - UserUID is the unique UID associated with this token + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_access_token', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_access_token_list.py b/library/k8s_v1_o_auth_access_token_list.py new file mode 100644 index 00000000..7b5820d2 --- /dev/null +++ b/library/k8s_v1_o_auth_access_token_list.py @@ -0,0 +1,343 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_access_token_list +short_description: Kubernetes OAuthAccessTokenList +description: +- Retrieve a list of o_auth_access_tokens. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_access_token_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of OAuth access tokens + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + authorize_token: + description: + - AuthorizeToken contains the token that authorized this token + type: str + client_name: + description: + - ClientName references the client that created this token. + type: str + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + type: str + refresh_token: + description: + - RefreshToken is the value by which this token can be renewed. Can be blank. + type: str + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + contains: str + user_name: + description: + - UserName is the user name associated with this token + type: str + user_uid: + description: + - UserUID is the unique UID associated with this token + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_access_token_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_authorize_token.py b/library/k8s_v1_o_auth_authorize_token.py new file mode 100644 index 00000000..e1965263 --- /dev/null +++ b/library/k8s_v1_o_auth_authorize_token.py @@ -0,0 +1,349 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_authorize_token +short_description: Kubernetes OAuthAuthorizeToken +description: +- Manage the lifecycle of a o_auth_authorize_token object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + client_name: + description: + - ClientName references the client that created this token. + code_challenge: + description: + - CodeChallenge is the optional code_challenge associated with this authorization + code, as described in rfc7636 + code_challenge_method: + description: + - CodeChallengeMethod is the optional code_challenge_method associated with this + authorization code, as described in rfc7636 + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - State data from request + user_name: + description: + - UserName is the user name associated with this token + user_uid: + description: + - UserUID is the unique UID associated with this token. UserUID and UserName must + both match for this token to be valid. + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_authorize_token: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + client_name: + description: + - ClientName references the client that created this token. + type: str + code_challenge: + description: + - CodeChallenge is the optional code_challenge associated with this authorization + code, as described in rfc7636 + type: str + code_challenge_method: + description: + - CodeChallengeMethod is the optional code_challenge_method associated with + this authorization code, as described in rfc7636 + type: str + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + type: str + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + contains: str + state: + description: + - State data from request + type: str + user_name: + description: + - UserName is the user name associated with this token + type: str + user_uid: + description: + - UserUID is the unique UID associated with this token. UserUID and UserName + must both match for this token to be valid. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_authorize_token', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_authorize_token_list.py b/library/k8s_v1_o_auth_authorize_token_list.py new file mode 100644 index 00000000..a3dedc4a --- /dev/null +++ b/library/k8s_v1_o_auth_authorize_token_list.py @@ -0,0 +1,350 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_authorize_token_list +short_description: Kubernetes OAuthAuthorizeTokenList +description: +- Retrieve a list of o_auth_authorize_tokens. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_authorize_token_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of OAuth authorization tokens + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + client_name: + description: + - ClientName references the client that created this token. + type: str + code_challenge: + description: + - CodeChallenge is the optional code_challenge associated with this authorization + code, as described in rfc7636 + type: str + code_challenge_method: + description: + - CodeChallengeMethod is the optional code_challenge_method associated with + this authorization code, as described in rfc7636 + type: str + expires_in: + description: + - ExpiresIn is the seconds from CreationTime before this token expires. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + redirect_uri: + description: + - RedirectURI is the redirection associated with the token. + type: str + scopes: + description: + - Scopes is an array of the requested scopes. + type: list + contains: str + state: + description: + - State data from request + type: str + user_name: + description: + - UserName is the user name associated with this token + type: str + user_uid: + description: + - UserUID is the unique UID associated with this token. UserUID and UserName + must both match for this token to be valid. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_authorize_token_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_client.py b/library/k8s_v1_o_auth_client.py new file mode 100644 index 00000000..0a983009 --- /dev/null +++ b/library/k8s_v1_o_auth_client.py @@ -0,0 +1,383 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_client +short_description: Kubernetes OAuthClient +description: +- Manage the lifecycle of a o_auth_client object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + additional_secrets: + description: + - AdditionalSecrets holds other secrets that may be used to identify the client. + This is useful for rotation and for service account token validation + type: list + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + grant_method: + description: + - 'GrantMethod determines how to handle grants for this client. If no method is + provided, the cluster default grant handling method will be used. Valid grant + handling methods are: - auto: always approves grant requests, useful for trusted + clients - prompt: prompts the end user for approval of grant requests, useful + for third-party clients - deny: always denies grant requests, useful for black-listed + clients' + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + redirect_ur_is: + description: + - RedirectURIs is the valid redirection URIs associated with a client + type: list + respond_with_challenges: + description: + - RespondWithChallenges indicates whether the client wants authentication needed + responses made in the form of challenges instead of redirects + type: bool + scope_restrictions: + description: + - ScopeRestrictions describes which scopes this client can request. Each requested + scope is checked against each restriction. If any restriction matches, then + the scope is allowed. If no restriction matches, then the scope is denied. + type: list + secret: + description: + - Secret is the unique secret associated with a client + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_client: + type: complex + returned: when I(state) = C(present) + contains: + additional_secrets: + description: + - AdditionalSecrets holds other secrets that may be used to identify the client. + This is useful for rotation and for service account token validation + type: list + contains: str + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + grant_method: + description: + - 'GrantMethod determines how to handle grants for this client. If no method + is provided, the cluster default grant handling method will be used. Valid + grant handling methods are: - auto: always approves grant requests, useful + for trusted clients - prompt: prompts the end user for approval of grant requests, + useful for third-party clients - deny: always denies grant requests, useful + for black-listed clients' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + redirect_ur_is: + description: + - RedirectURIs is the valid redirection URIs associated with a client + type: list + contains: str + respond_with_challenges: + description: + - RespondWithChallenges indicates whether the client wants authentication needed + responses made in the form of challenges instead of redirects + type: bool + scope_restrictions: + description: + - ScopeRestrictions describes which scopes this client can request. Each requested + scope is checked against each restriction. If any restriction matches, then + the scope is allowed. If no restriction matches, then the scope is denied. + type: list + contains: + cluster_role: + description: + - ClusterRole describes a set of restrictions for cluster role scoping. + type: complex + contains: + allow_escalation: + description: + - AllowEscalation indicates whether you can request roles and their + escalating resources + type: bool + namespaces: + description: + - Namespaces is the list of namespaces that can be referenced. * means + any of them (including *) + type: list + contains: str + role_names: + description: + - RoleNames is the list of cluster roles that can referenced. * means + anything + type: list + contains: str + literals: + description: + - ExactValues means the scope has to match a particular set of strings exactly + type: list + contains: str + secret: + description: + - Secret is the unique secret associated with a client + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_client', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_client_authorization.py b/library/k8s_v1_o_auth_client_authorization.py new file mode 100644 index 00000000..a66ecf29 --- /dev/null +++ b/library/k8s_v1_o_auth_client_authorization.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_client_authorization +short_description: Kubernetes OAuthClientAuthorization +description: +- Manage the lifecycle of a o_auth_client_authorization object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + client_name: + description: + - ClientName references the client that created this authorization + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + scopes: + description: + - Scopes is an array of the granted scopes. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + user_name: + description: + - UserName is the user name that authorized this client + user_uid: + description: + - UserUID is the unique UID associated with this authorization. UserUID and UserName + must both match for this authorization to be valid. + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_client_authorization: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + client_name: + description: + - ClientName references the client that created this authorization + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + scopes: + description: + - Scopes is an array of the granted scopes. + type: list + contains: str + user_name: + description: + - UserName is the user name that authorized this client + type: str + user_uid: + description: + - UserUID is the unique UID associated with this authorization. UserUID and + UserName must both match for this authorization to be valid. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_client_authorization', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_client_authorization_list.py b/library/k8s_v1_o_auth_client_authorization_list.py new file mode 100644 index 00000000..bf507236 --- /dev/null +++ b/library/k8s_v1_o_auth_client_authorization_list.py @@ -0,0 +1,328 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_client_authorization_list +short_description: Kubernetes OAuthClientAuthorizationList +description: +- Retrieve a list of o_auth_client_authorizations. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_client_authorization_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of OAuth client authorizations + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + client_name: + description: + - ClientName references the client that created this authorization + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + scopes: + description: + - Scopes is an array of the granted scopes. + type: list + contains: str + user_name: + description: + - UserName is the user name that authorized this client + type: str + user_uid: + description: + - UserUID is the unique UID associated with this authorization. UserUID + and UserName must both match for this authorization to be valid. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_client_authorization_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_o_auth_client_list.py b/library/k8s_v1_o_auth_client_list.py new file mode 100644 index 00000000..be18dd8f --- /dev/null +++ b/library/k8s_v1_o_auth_client_list.py @@ -0,0 +1,375 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_o_auth_client_list +short_description: Kubernetes OAuthClientList +description: +- Retrieve a list of o_auth_clients. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +o_auth_client_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of OAuth clients + type: list + contains: + additional_secrets: + description: + - AdditionalSecrets holds other secrets that may be used to identify the + client. This is useful for rotation and for service account token validation + type: list + contains: str + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + grant_method: + description: + - 'GrantMethod determines how to handle grants for this client. If no method + is provided, the cluster default grant handling method will be used. Valid + grant handling methods are: - auto: always approves grant requests, useful + for trusted clients - prompt: prompts the end user for approval of grant + requests, useful for third-party clients - deny: always denies grant requests, + useful for black-listed clients' + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + redirect_ur_is: + description: + - RedirectURIs is the valid redirection URIs associated with a client + type: list + contains: str + respond_with_challenges: + description: + - RespondWithChallenges indicates whether the client wants authentication + needed responses made in the form of challenges instead of redirects + type: bool + scope_restrictions: + description: + - ScopeRestrictions describes which scopes this client can request. Each + requested scope is checked against each restriction. If any restriction + matches, then the scope is allowed. If no restriction matches, then the + scope is denied. + type: list + contains: + cluster_role: + description: + - ClusterRole describes a set of restrictions for cluster role scoping. + type: complex + contains: + allow_escalation: + description: + - AllowEscalation indicates whether you can request roles and their + escalating resources + type: bool + namespaces: + description: + - Namespaces is the list of namespaces that can be referenced. * + means any of them (including *) + type: list + contains: str + role_names: + description: + - RoleNames is the list of cluster roles that can referenced. * + means anything + type: list + contains: str + literals: + description: + - ExactValues means the scope has to match a particular set of strings + exactly + type: list + contains: str + secret: + description: + - Secret is the unique secret associated with a client + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('o_auth_client_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_persistent_volume.py b/library/k8s_v1_persistent_volume.py new file mode 100644 index 00000000..a57ce7af --- /dev/null +++ b/library/k8s_v1_persistent_volume.py @@ -0,0 +1,1268 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_persistent_volume +short_description: Kubernetes PersistentVolume +description: +- Manage the lifecycle of a persistent_volume object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_access_modes: + description: + - AccessModes contains all ways the volume can be mounted. + aliases: + - access_modes + type: list + spec_aws_elastic_block_store_fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating system. Examples: "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' + aliases: + - aws_elastic_block_store_fs_type + spec_aws_elastic_block_store_partition: + description: + - 'The partition in the volume that you want to mount. If omitted, the default + is to mount by volume name. Examples: For volume /dev/sda1, you specify the + partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you + can leave the property empty).' + aliases: + - aws_elastic_block_store_partition + type: int + spec_aws_elastic_block_store_read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". + If omitted, the default is "false". + aliases: + - aws_elastic_block_store_read_only + type: bool + spec_aws_elastic_block_store_volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS volume). + aliases: + - aws_elastic_block_store_volume_id + spec_azure_disk_caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + aliases: + - azure_disk_caching_mode + spec_azure_disk_disk_name: + description: + - The Name of the data disk in the blob storage + aliases: + - azure_disk_disk_name + spec_azure_disk_disk_uri: + description: + - The URI the data disk in the blob storage + aliases: + - azure_disk_disk_uri + spec_azure_disk_fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + aliases: + - azure_disk_fs_type + spec_azure_disk_read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting + in VolumeMounts. + aliases: + - azure_disk_read_only + type: bool + spec_azure_file_read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting + in VolumeMounts. + aliases: + - azure_file_read_only + type: bool + spec_azure_file_secret_name: + description: + - the name of secret that contains Azure Storage Account Name and Key + aliases: + - azure_file_secret_name + spec_azure_file_share_name: + description: + - Share Name + aliases: + - azure_file_share_name + spec_capacity: + description: + - A description of the persistent volume's resources and capacity. + aliases: + - capacity + type: dict + spec_cephfs_monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + aliases: + - cephfs_monitors + type: list + spec_cephfs_path: + description: + - 'Optional: Used as the mounted root, rather than the full Ceph tree, default + is /' + aliases: + - cephfs_path + spec_cephfs_read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' + aliases: + - cephfs_read_only + type: bool + spec_cephfs_secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret' + aliases: + - cephfs_secret_file + spec_cephfs_secret_ref_name: + description: + - Name of the referent. + aliases: + - cephfs_secret_ref_name + spec_cephfs_user: + description: + - 'Optional: User is the rados user name, default is admin' + aliases: + - cephfs_user + spec_cinder_fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified.' + aliases: + - cinder_fs_type + spec_cinder_read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' + aliases: + - cinder_read_only + type: bool + spec_cinder_volume_id: + description: + - volume id used to identify the volume in cinder + aliases: + - cinder_volume_id + spec_claim_ref_api_version: + description: + - API version of the referent. + aliases: + - claim_ref_api_version + spec_claim_ref_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - claim_ref_field_path + spec_claim_ref_kind: + description: + - Kind of the referent. + aliases: + - claim_ref_kind + spec_claim_ref_name: + description: + - Name of the referent. + aliases: + - claim_ref_name + spec_claim_ref_namespace: + description: + - Namespace of the referent. + aliases: + - claim_ref_namespace + spec_claim_ref_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - claim_ref_resource_version + spec_claim_ref_uid: + description: + - UID of the referent. + aliases: + - claim_ref_uid + spec_fc_fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + aliases: + - fc_fs_type + spec_fc_lun: + description: + - 'Required: FC target lun number' + aliases: + - fc_lun + type: int + spec_fc_read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' + aliases: + - fc_read_only + type: bool + spec_fc_target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + aliases: + - fc_target_ww_ns + type: list + spec_flex_volume_driver: + description: + - Driver is the name of the driver to use for this volume. + aliases: + - flex_volume_driver + spec_flex_volume_fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + aliases: + - flex_volume_fs_type + spec_flex_volume_options: + description: + - 'Optional: Extra command options if any.' + aliases: + - flex_volume_options + type: dict + spec_flex_volume_read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' + aliases: + - flex_volume_read_only + type: bool + spec_flex_volume_secret_ref_name: + description: + - Name of the referent. + aliases: + - flex_volume_secret_ref_name + spec_flocker_dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset for Flocker should + be considered as deprecated + aliases: + - flocker_dataset_name + spec_flocker_dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker dataset + aliases: + - flocker_dataset_uuid + spec_gce_persistent_disk_fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating system. Examples: "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' + aliases: + - gce_persistent_disk_fs_type + spec_gce_persistent_disk_partition: + description: + - 'The partition in the volume that you want to mount. If omitted, the default + is to mount by volume name. Examples: For volume /dev/sda1, you specify the + partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you + can leave the property empty).' + aliases: + - gce_persistent_disk_partition + type: int + spec_gce_persistent_disk_pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the disk in GCE. + aliases: + - gce_persistent_disk_pd_name + spec_gce_persistent_disk_read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + aliases: + - gce_persistent_disk_read_only + type: bool + spec_glusterfs_endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs topology. + aliases: + - glusterfs_endpoints + spec_glusterfs_path: + description: + - Path is the Glusterfs volume path. + aliases: + - glusterfs_path + spec_glusterfs_read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. + Defaults to false. + aliases: + - glusterfs_read_only + type: bool + spec_host_path_path: + description: + - Path of the directory on the host. + aliases: + - host_path_path + spec_iscsi_fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating system. Examples: "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' + aliases: + - iscsi_fs_type + spec_iscsi_iqn: + description: + - Target iSCSI Qualified Name. + aliases: + - iscsi_iqn + spec_iscsi_iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI\ + \ transport." + aliases: + - iscsi_iscsi_interface + spec_iscsi_lun: + description: + - iSCSI target lun number. + aliases: + - iscsi_lun + type: int + spec_iscsi_read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + aliases: + - iscsi_read_only + type: bool + spec_iscsi_target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and 3260). + aliases: + - iscsi_target_portal + spec_nfs_path: + description: + - Path that is exported by the NFS server. + aliases: + - nfs_path + spec_nfs_read_only: + description: + - ReadOnly here will force the NFS export to be mounted with read-only permissions. + Defaults to false. + aliases: + - nfs_read_only + type: bool + spec_nfs_server: + description: + - Server is the hostname or IP address of the NFS server. + aliases: + - nfs_server + spec_persistent_volume_reclaim_policy: + description: + - What happens to a persistent volume when released from its claim. Valid options + are Retain (default) and Recycle. Recycling must be supported by the volume + plugin underlying this persistent volume. + aliases: + - persistent_volume_reclaim_policy + spec_photon_persistent_disk_fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + aliases: + - photon_persistent_disk_fs_type + spec_photon_persistent_disk_pd_id: + description: + - ID that identifies Photon Controller persistent disk + aliases: + - photon_persistent_disk_pd_id + spec_quobyte_group: + description: + - Group to map volume access to Default is no group + aliases: + - quobyte_group + spec_quobyte_read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. + Defaults to false. + aliases: + - quobyte_read_only + type: bool + spec_quobyte_registry: + description: + - Registry represents a single or multiple Quobyte Registry services specified + as a string as host:port pair (multiple entries are separated with commas) which + acts as the central registry for volumes + aliases: + - quobyte_registry + spec_quobyte_user: + description: + - User to map volume access to Defaults to serivceaccount user + aliases: + - quobyte_user + spec_quobyte_volume: + description: + - Volume is a string that references an already created Quobyte volume by name. + aliases: + - quobyte_volume + spec_rbd_fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating system. Examples: "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' + aliases: + - rbd_fs_type + spec_rbd_image: + description: + - The rados image name. + aliases: + - rbd_image + spec_rbd_keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + aliases: + - rbd_keyring + spec_rbd_monitors: + description: + - A collection of Ceph monitors. + aliases: + - rbd_monitors + type: list + spec_rbd_pool: + description: + - The rados pool name. Default is rbd. + aliases: + - rbd_pool + spec_rbd_read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + aliases: + - rbd_read_only + type: bool + spec_rbd_secret_ref_name: + description: + - Name of the referent. + aliases: + - rbd_secret_ref_name + spec_rbd_user: + description: + - The rados user name. Default is admin. + aliases: + - rbd_user + spec_vsphere_volume_fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + aliases: + - vsphere_volume_fs_type + spec_vsphere_volume_volume_path: + description: + - Path that identifies vSphere volume vmdk + aliases: + - vsphere_volume_volume_path + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +persistent_volume: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines a specification of a persistent volume owned by the cluster. + Provisioned by an administrator. + type: complex + contains: + access_modes: + description: + - AccessModes contains all ways the volume can be mounted. + type: list + contains: str + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, the + default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts + to "true". If omitted, the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host and bind mount + to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the + host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host and bind + mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account Name and Key + type: str + share_name: + description: + - Share Name + type: str + capacity: + description: + - A description of the persistent volume's resources and capacity. + type: complex + contains: str, ResourceQuantity + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full Ceph tree, + default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default is + /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication secret for + User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on kubelets host + machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported by + the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + claim_ref: + description: + - ClaimRef is part of a bi-directional binding between PersistentVolume + and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName + is the authoritative bind between PV and PVC. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the + host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in + future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the + host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem + depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may be empty + if no secret object is specified. If the secret object contains more + than one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's host machine + and exposed to the pod for its usage. This depends on the Flocker control + service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset for + Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. Provisioned by an + admin. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, the + default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the disk in + GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults + to false. + type: bool + glusterfs: + description: + - Glusterfs represents a Glusterfs volume that is attached to a host and + exposed to the pod. Provisioned by an admin. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted with read-only + permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a directory on the host. Provisioned by a developer + or tester. This is useful for single-node development and testing only! + On-host storage is not supported in any way and WILL NOT WORK in a multi-node + cluster. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to a kubelet's + host machine and then exposed to the pod. Provisioned by an admin. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name that\ + \ uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults + to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port if + the port is other than default (typically TCP ports 860 and 3260). + type: str + nfs: + description: + - NFS represents an NFS mount on the host. Provisioned by an admin. + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted with read-only + permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_reclaim_policy: + description: + - What happens to a persistent volume when released from its claim. Valid + options are Retain (default) and Recycle. Recycling must be supported + by the volume plugin underlying this persistent volume. + type: str + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent disk attached + and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the + host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted with read-only + permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are separated + with commas) which acts as the central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount user + type: str + volume: + description: + - Volume is a string that references an already created Quobyte volume + by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that shares a pod's + lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults + to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. If provided + overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported by the + host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status represents the current information/status for the persistent volume. + Populated by the system. Read-only. + type: complex + contains: + message: + description: + - A human-readable message indicating details about why the volume is in + this state. + type: str + phase: + description: + - Phase indicates if a volume is available, bound to a claim, or released + by a claim. + type: str + reason: + description: + - Reason is a brief CamelCase string that describes any failure and is meant + for machine parsing and tidy display in the CLI. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('persistent_volume', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_persistent_volume_claim.py b/library/k8s_v1_persistent_volume_claim.py new file mode 100644 index 00000000..f3cb7605 --- /dev/null +++ b/library/k8s_v1_persistent_volume_claim.py @@ -0,0 +1,419 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_persistent_volume_claim +short_description: Kubernetes PersistentVolumeClaim +description: +- Manage the lifecycle of a persistent_volume_claim object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_access_modes: + description: + - AccessModes contains the desired access modes the volume should have. + aliases: + - access_modes + type: list + spec_resources_limits: + description: + - Limits describes the maximum amount of compute resources allowed. + aliases: + - resources_limits + type: dict + spec_resources_requests: + description: + - Requests describes the minimum amount of compute resources required. If Requests + is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + aliases: + - resources_requests + type: dict + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_volume_name: + description: + - VolumeName is the binding reference to the PersistentVolume backing this claim. + aliases: + - volume_name + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +persistent_volume_claim: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired characteristics of a volume requested by a pod author. + type: complex + contains: + access_modes: + description: + - AccessModes contains the desired access modes the volume should have. + type: list + contains: str + resources: + description: + - Resources represents the minimum resources the volume should have. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that + is explicitly specified, otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + selector: + description: + - A label query over volumes to consider for binding. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + volume_name: + description: + - VolumeName is the binding reference to the PersistentVolume backing this + claim. + type: str + status: + description: + - Status represents the current information/status of a persistent volume claim. + Read-only. + type: complex + contains: + access_modes: + description: + - AccessModes contains the actual access modes the volume backing the PVC + has. + type: list + contains: str + capacity: + description: + - Represents the actual resources of the underlying volume. + type: complex + contains: str, ResourceQuantity + phase: + description: + - Phase represents the current phase of PersistentVolumeClaim. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('persistent_volume_claim', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_persistent_volume_claim_list.py b/library/k8s_v1_persistent_volume_claim_list.py new file mode 100644 index 00000000..20092e65 --- /dev/null +++ b/library/k8s_v1_persistent_volume_claim_list.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_persistent_volume_claim_list +short_description: Kubernetes PersistentVolumeClaimList +description: +- Retrieve a list of persistent_volume_claims. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +persistent_volume_claim_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - A list of persistent volume claims. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired characteristics of a volume requested by a pod + author. + type: complex + contains: + access_modes: + description: + - AccessModes contains the desired access modes the volume should have. + type: list + contains: str + resources: + description: + - Resources represents the minimum resources the volume should have. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + selector: + description: + - A label query over volumes to consider for binding. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + volume_name: + description: + - VolumeName is the binding reference to the PersistentVolume backing + this claim. + type: str + status: + description: + - Status represents the current information/status of a persistent volume + claim. Read-only. + type: complex + contains: + access_modes: + description: + - AccessModes contains the actual access modes the volume backing the + PVC has. + type: list + contains: str + capacity: + description: + - Represents the actual resources of the underlying volume. + type: complex + contains: str, ResourceQuantity + phase: + description: + - Phase represents the current phase of PersistentVolumeClaim. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('persistent_volume_claim_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_persistent_volume_list.py b/library/k8s_v1_persistent_volume_list.py new file mode 100644 index 00000000..8bea1a38 --- /dev/null +++ b/library/k8s_v1_persistent_volume_list.py @@ -0,0 +1,846 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_persistent_volume_list +short_description: Kubernetes PersistentVolumeList +description: +- Retrieve a list of persistent_volumes. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +persistent_volume_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of persistent volumes. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines a specification of a persistent volume owned by the cluster. + Provisioned by an administrator. + type: complex + contains: + access_modes: + description: + - AccessModes contains all ways the volume can be mounted. + type: list + contains: str + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts + to "true". If omitted, the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host and bind + mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host and bind + mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account Name and + Key + type: str + share_name: + description: + - Share Name + type: str + capacity: + description: + - A description of the persistent volume's resources and capacity. + type: complex + contains: str, ResourceQuantity + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares a pod's + lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full Ceph + tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default + is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication secret + for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + claim_ref: + description: + - ClaimRef is part of a bi-directional binding between PersistentVolume + and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName + is the authoritative bind between PV and PVC. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change + in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". The default + filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may + be empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's host machine + and exposed to the pod for its usage. This depends on the Flocker + control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset + for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. Provisioned + by an admin. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the disk + in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + glusterfs: + description: + - Glusterfs represents a Glusterfs volume that is attached to a host + and exposed to the pod. Provisioned by an admin. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted with + read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a directory on the host. Provisioned by a developer + or tester. This is useful for single-node development and testing + only! On-host storage is not supported in any way and WILL NOT WORK + in a multi-node cluster. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to a kubelet's + host machine and then exposed to the pod. Provisioned by an admin. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name that\ + \ uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports 860 and + 3260). + type: str + nfs: + description: + - NFS represents an NFS mount on the host. Provisioned by an admin. + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted with read-only + permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_reclaim_policy: + description: + - What happens to a persistent volume when released from its claim. + Valid options are Retain (default) and Recycle. Recycling must be + supported by the volume plugin underlying this persistent volume. + type: str + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent disk + attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares a pod's + lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted with + read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are + separated with commas) which acts as the central registry for + volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount user + type: str + volume: + description: + - Volume is a string that references an already created Quobyte + volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that shares + a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. If + provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status represents the current information/status for the persistent volume. + Populated by the system. Read-only. + type: complex + contains: + message: + description: + - A human-readable message indicating details about why the volume is + in this state. + type: str + phase: + description: + - Phase indicates if a volume is available, bound to a claim, or released + by a claim. + type: str + reason: + description: + - Reason is a brief CamelCase string that describes any failure and + is meant for machine parsing and tidy display in the CLI. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('persistent_volume_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod.py b/library/k8s_v1_pod.py new file mode 100644 index 00000000..d62db0e7 --- /dev/null +++ b/library/k8s_v1_pod.py @@ -0,0 +1,2266 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod +short_description: Kubernetes Pod +description: +- Manage the lifecycle of a pod object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative + to StartTime before the system will actively try to mark it failed and + kill associated containers. Value must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently be + added or removed. There must be at least one container in a Pod. Cannot + be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used if this\ + \ is not provided. Variable references $(VAR_NAME) are expanded using\ + \ the container's environment. If a variable cannot be resolved, the\ + \ reference in the input string will be unchanged. The $(VAR_NAME)\ + \ syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether the variable\ + \ exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker image's\ + \ ENTRYPOINT is used if this is not provided. Variable references\ + \ $(VAR_NAME) are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\ + \ regardless of whether the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the reference + in the input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether the variable exists + or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used if + value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, + status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in terms + of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu and + requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for env + vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults to + Always if :latest tag is specified, or IfNotPresent otherwise. Cannot + be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response to container + lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and restarted + according to its restart policy. Other management of the container + blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. The reason + for termination is passed to the handler. Regardless of the outcome + of the handler, the container is eventually terminated. Other + management of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec specifies + the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in the + container's filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered failed + after having succeeded. Defaults to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. Number + must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 seconds. + Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered successful + after having failed. Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. Number + must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults to + 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container in + a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port here gives + the system additional information about the network connections a + container uses, but is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. Any port which + is listening on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This must be + a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this must + be a valid port number, 0 < x < 65536. If HostNetwork is specified, + this must match ContainerPort. Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique within + the pod. Each named port in a pod must have a unique name. Name + for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will be removed + from service endpoints if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec specifies + the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in the + container's filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered failed + after having succeeded. Defaults to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. Number + must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 seconds. + Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered successful + after having failed. Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. Number + must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults to + 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. Defaults + to the default set of capabilities granted by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged containers + are essentially equivalent to root on the host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. Default + is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, + the Kubelet will validate the image at runtime to ensure that + it does not run as UID 0 (root) and fail to start the container + if it does. If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also be + set in PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext takes + precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If unspecified, + the container runtime will allocate a random SELinux context for + each container. May also be set in PodSecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin in the container + runtime. If this is not set, reads from stdin in the container will + always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel after + it has been opened by a single attach. When stdin is true the stdin + stream will remain open across multiple attach sessions. If stdinOnce + is set to true, stdin is opened on container start, is empty until + the first client attaches to stdin, and then remains open and accepts + data until the client disconnects, at which time stdin is closed and + remains closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive an + EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's termination\ + \ message will be written is mounted into the container's filesystem.\ + \ Message written is intended to be brief final status, such as an\ + \ assertion failure message. Defaults to /dev/termination-log. Cannot\ + \ be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also requires + 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be mounted. + Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false or unspecified). + Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume should + be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container runtime's + default will be used, which might be configured in the container image. + Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or + 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. + If this option is set, the ports that will be used must be specified. + Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname + will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same + namespace to use for pulling any of the images used by this PodSpec. If + specified, these secrets will be passed to individual puller implementations + for them to use. For example, in the case of docker, only DockerConfig + type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it + is non-empty, the scheduler simply schedules this pod onto that node, + assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a + node. Selector which must match a node's labels for the pod to be scheduled + on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common container + settings. Optional: Defaults to empty. See type description for default + values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1. The owning GID will be\ + \ the FSGroup 2. The setgid bit is set (new files created in the volume\ + \ will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\ + \ If unset, the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, + the Kubelet will validate the image at runtime to ensure that it does + not run as UID 0 (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. May also + be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to + user specified in image metadata if unspecified. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context for each + container. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes + precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each container, + in addition to the container's primary GID. If unspecified, no groups + will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this + pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have + a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May + be decreased in delete request. Value must be non-negative integer. The + value zero indicates delete immediately. If this value is nil, the default + grace period will be used instead. The grace period is the duration in + seconds after the processes running in the pod are sent a termination + signal and the time when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts + to "true". If omitted, the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host and bind + mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host and bind + mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account Name and + Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares a pod's + lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full Ceph + tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default + is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication secret + for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories within + the path are not affected by this setting. This might be in conflict + with other options that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the referenced + ConfigMap will be projected into the volume as a file whose name + is the key and content is the value. If specified, the listed + keys will be projected into the specified paths, and unlisted + keys will not be present. If a key is specified which is not present + in the ConfigMap, the volume setup will error. Paths must be relative + and may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not be + an absolute path. May not contain the path element '..'. May + not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories within + the path are not affected by this setting. This might be in conflict + with other options that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, labels, + name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in terms + of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file to be\ + \ created. Must not be absolute or contain the '..' path.\ + \ Must be utf-8 encoded. The first item of the relative path\ + \ must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu and + requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for env + vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. The default + is "" which means to use the node's default medium. Must be an + empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change + in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". The default + filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This may + be empty if no secret object is specified. If the secret object + contains more than one secret, all secrets are passed to the plugin + scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's host machine. + This depends on the Flocker control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset + for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the disk + in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with '..'. If + '.' is supplied, the volume directory will be the git repository. + Otherwise, if specified, the volume will contain the git repository + in the subdirectory with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares a pod's + lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted with + read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the host machine + that is directly exposed to the container. This is generally used + for system agents or other privileged things that are allowed to see + the host machine. Most containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name that\ + \ uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports 860 and + 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate this + volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories within + the path are not affected by this setting. This might be in conflict + with other options that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, labels, + name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in terms + of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file to be\ + \ created. Must not be absolute or contain the '..' path.\ + \ Must be utf-8 encoded. The first item of the relative path\ + \ must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu and + requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for env + vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted with read-only + permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim + in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the same namespace + as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent disk + attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares a pod's + lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted with + read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry services + specified as a string as host:port pair (multiple entries are + separated with commas) which acts as the central registry for + volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount user + type: str + volume: + description: + - Volume is a string that references an already created Quobyte + volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that shares + a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: Ensure + that the filesystem type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. If + provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories within + the path are not affected by this setting. This might be in conflict + with other options that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the referenced + Secret will be projected into the volume as a file whose name + is the key and content is the value. If specified, the listed + keys will be projected into the specified paths, and unlisted + keys will not be present. If a key is specified which is not present + in the Secret, the volume setup will error. Paths must be relative + and may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not be + an absolute path. May not contain the path element '..'. May + not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Most recently observed status of the pod. This data may not be up to date. + Populated by the system. Read-only. + type: complex + contains: + conditions: + description: + - Current service state of pod. + type: list + contains: + last_probe_time: + description: + - Last time we probed the condition. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - Human-readable message indicating details about last transition. + type: str + reason: + description: + - Unique, one-word, CamelCase reason for the condition's last transition. + type: str + status: + description: + - Status is the status of the condition. Can be True, False, Unknown. + type: str + type: + description: + - Type is the type of the condition. Currently only Ready. + type: str + container_statuses: + description: + - The list has one entry per container in the manifest. Each entry is currently + the output of `docker inspect`. + type: list + contains: + container_id: + description: + - Container's ID in the format 'docker://'. + type: str + image: + description: + - The image the container is running. + type: str + image_id: + description: + - ImageID of the container's image. + type: str + last_state: + description: + - Details about the container's last termination condition. + type: complex + contains: + running: + description: + - Details about a running container + type: complex + contains: + started_at: + description: + - Time at which the container was last (re-)started + type: complex + contains: {} + terminated: + description: + - Details about a terminated container + type: complex + contains: + container_id: + description: + - Container's ID in the format 'docker://' + type: str + exit_code: + description: + - Exit status from the last termination of the container + type: int + finished_at: + description: + - Time at which the container last terminated + type: complex + contains: {} + message: + description: + - Message regarding the last termination of the container + type: str + reason: + description: + - (brief) reason from the last termination of the container + type: str + signal: + description: + - Signal from the last termination of the container + type: int + started_at: + description: + - Time at which previous execution of the container started + type: complex + contains: {} + waiting: + description: + - Details about a waiting container + type: complex + contains: + message: + description: + - Message regarding why the container is not yet running. + type: str + reason: + description: + - (brief) reason the container is not yet running. + type: str + name: + description: + - This must be a DNS_LABEL. Each container in a pod must have a unique + name. Cannot be updated. + type: str + ready: + description: + - Specifies whether the container has passed its readiness probe. + type: bool + restart_count: + description: + - The number of times the container has been restarted, currently based + on the number of dead containers that have not yet been removed. Note + that this is calculated from dead containers. But those containers + are subject to garbage collection. This value will get capped at 5 + by GC. + type: int + state: + description: + - Details about the container's current condition. + type: complex + contains: + running: + description: + - Details about a running container + type: complex + contains: + started_at: + description: + - Time at which the container was last (re-)started + type: complex + contains: {} + terminated: + description: + - Details about a terminated container + type: complex + contains: + container_id: + description: + - Container's ID in the format 'docker://' + type: str + exit_code: + description: + - Exit status from the last termination of the container + type: int + finished_at: + description: + - Time at which the container last terminated + type: complex + contains: {} + message: + description: + - Message regarding the last termination of the container + type: str + reason: + description: + - (brief) reason from the last termination of the container + type: str + signal: + description: + - Signal from the last termination of the container + type: int + started_at: + description: + - Time at which previous execution of the container started + type: complex + contains: {} + waiting: + description: + - Details about a waiting container + type: complex + contains: + message: + description: + - Message regarding why the container is not yet running. + type: str + reason: + description: + - (brief) reason the container is not yet running. + type: str + host_ip: + description: + - IP address of the host to which the pod is assigned. Empty if not yet + scheduled. + type: str + message: + description: + - A human readable message indicating details about why the pod is in this + condition. + type: str + phase: + description: + - Current condition of the pod. + type: str + pod_ip: + description: + - IP address allocated to the pod. Routable at least within the cluster. + Empty if not yet allocated. + type: str + reason: + description: + - A brief CamelCase message indicating details about why the pod is in this + state. e.g. 'OutOfDisk' + type: str + start_time: + description: + - RFC 3339 date and time at which the object was acknowledged by the Kubelet. + This is before the Kubelet pulled the container image(s) for the pod. + type: complex + contains: {} +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_list.py b/library/k8s_v1_pod_list.py new file mode 100644 index 00000000..3bad099f --- /dev/null +++ b/library/k8s_v1_pod_list.py @@ -0,0 +1,2146 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_list +short_description: Kubernetes PodList +description: +- Retrieve a list of pods. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of pods. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative + to StartTime before the system will actively try to mark it failed + and kill associated containers. Value must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a Pod. + Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used if\ + \ this is not provided. Variable references $(VAR_NAME) are expanded\ + \ using the container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged. The $(VAR_NAME)\ + \ syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether the\ + \ variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker image's\ + \ ENTRYPOINT is used if this is not provided. Variable references\ + \ $(VAR_NAME) are expanded using the container's environment.\ + \ If a variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can be escaped\ + \ with a double $$, ie: $$(VAR_NAME). Escaped references will\ + \ never be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response to + container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and restarted + according to its restart policy. Other management of the container + blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. The + reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum value + is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 + seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port here + gives the system additional information about the network connections + a container uses, but is primarily informational. Not specifying + a port here DOES NOT prevent that port from being exposed. Any + port which is listening on the default "0.0.0.0" address inside + a container will be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This must + be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this must + be a valid port number, 0 < x < 65536. If HostNetwork is specified, + this must match ContainerPort. Most containers do not need + this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique within + the pod. Each named port in a pod must have a unique name. + Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot be + updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum value + is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 + seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to an + implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. Defaults + to the default set of capabilities granted by the container + runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. Default + is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin in the + container runtime. If this is not set, reads from stdin in the + container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel after + it has been opened by a single attach. When stdin is true the + stdin stream will remain open across multiple attach sessions. + If stdinOnce is set to true, stdin is opened on container start, + is empty until the first client attaches to stdin, and then remains + open and accepts data until the client disconnects, at which time + stdin is closed and remains closed until the container is restarted. + If this flag is false, a container processes that reads from stdin + will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's termination\ + \ message will be written is mounted into the container's filesystem.\ + \ Message written is intended to be brief final status, such as\ + \ an assertion failure message. Defaults to /dev/termination-log.\ + \ Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot be + updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be mounted. + Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false or + unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume should + be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured in the + container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. + If this option is set, the ports that will be used must be specified. + Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname + will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the + same namespace to use for pulling any of the images used by this PodSpec. + If specified, these secrets will be passed to individual puller implementations + for them to use. For example, in the case of docker, only DockerConfig + type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If + it is non-empty, the scheduler simply schedules this pod onto that + node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on + a node. Selector which must match a node's labels for the pod to be + scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common container + settings. Optional: Defaults to empty. See type description for default + values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1. The owning GID will\ + \ be the FSGroup 2. The setgid bit is set (new files created in\ + \ the volume will be owned by FSGroup) 3. The permission bits\ + \ are OR'd with rw-rw---- If unset, the Kubelet will not modify\ + \ the ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, + the Kubelet will validate the image at runtime to ensure that + it does not run as UID 0 (root) and fail to start the container + if it does. If unset or false, no such validation will be performed. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also be + set in SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence for that + container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context for + each container. May also be set in SecurityContext. If set in + both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each container, + in addition to the container's primary GID. If unspecified, no + groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run + this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not + have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative integer. + The value zero indicates delete immediately. If this value is nil, + the default grace period will be used instead. The grace period is + the duration in seconds after the processes running in the pod are + sent a termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to the + pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume + /dev/sda1, you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can leave the + property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts + to "true". If omitted, the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS + volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host and + bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the + ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host and + bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the + ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account Name + and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares a pod's + lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default + is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication secret + for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the + referenced ConfigMap will be projected into the volume as + a file whose name is the key and content is the value. If + specified, the listed keys will be projected into the specified + paths, and unlisted keys will not be present. If a key is + specified which is not present in the ConfigMap, the volume + setup will error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not + be an absolute path. May not contain the path element + '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the '..'\ + \ path. Must be utf-8 encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. The + default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change + in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". The + default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This + may be empty if no secret object is specified. If the secret + object contains more than one secret, all secrets are passed + to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's host + machine. This depends on the Flocker control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset + for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume + /dev/sda1, you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can leave the + property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the + disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with '..'. + If '.' is supplied, the volume directory will be the git repository. + Otherwise, if specified, the volume will contain the git repository + in the subdirectory with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name\ + \ that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports 860 + and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the '..'\ + \ path. Must be utf-8 encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted with + read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the same + namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares a pod's + lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount user + type: str + volume: + description: + - Volume is a string that references an already created Quobyte + volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that shares + a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the + referenced Secret will be projected into the volume as a file + whose name is the key and content is the value. If specified, + the listed keys will be projected into the specified paths, + and unlisted keys will not be present. If a key is specified + which is not present in the Secret, the volume setup will + error. Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not + be an absolute path. May not contain the path element + '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Most recently observed status of the pod. This data may not be up to date. + Populated by the system. Read-only. + type: complex + contains: + conditions: + description: + - Current service state of pod. + type: list + contains: + last_probe_time: + description: + - Last time we probed the condition. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - Human-readable message indicating details about last transition. + type: str + reason: + description: + - Unique, one-word, CamelCase reason for the condition's last transition. + type: str + status: + description: + - Status is the status of the condition. Can be True, False, Unknown. + type: str + type: + description: + - Type is the type of the condition. Currently only Ready. + type: str + container_statuses: + description: + - The list has one entry per container in the manifest. Each entry is + currently the output of `docker inspect`. + type: list + contains: + container_id: + description: + - Container's ID in the format 'docker://'. + type: str + image: + description: + - The image the container is running. + type: str + image_id: + description: + - ImageID of the container's image. + type: str + last_state: + description: + - Details about the container's last termination condition. + type: complex + contains: + running: + description: + - Details about a running container + type: complex + contains: + started_at: + description: + - Time at which the container was last (re-)started + type: complex + contains: {} + terminated: + description: + - Details about a terminated container + type: complex + contains: + container_id: + description: + - Container's ID in the format 'docker://' + type: str + exit_code: + description: + - Exit status from the last termination of the container + type: int + finished_at: + description: + - Time at which the container last terminated + type: complex + contains: {} + message: + description: + - Message regarding the last termination of the container + type: str + reason: + description: + - (brief) reason from the last termination of the container + type: str + signal: + description: + - Signal from the last termination of the container + type: int + started_at: + description: + - Time at which previous execution of the container started + type: complex + contains: {} + waiting: + description: + - Details about a waiting container + type: complex + contains: + message: + description: + - Message regarding why the container is not yet running. + type: str + reason: + description: + - (brief) reason the container is not yet running. + type: str + name: + description: + - This must be a DNS_LABEL. Each container in a pod must have a + unique name. Cannot be updated. + type: str + ready: + description: + - Specifies whether the container has passed its readiness probe. + type: bool + restart_count: + description: + - The number of times the container has been restarted, currently + based on the number of dead containers that have not yet been + removed. Note that this is calculated from dead containers. But + those containers are subject to garbage collection. This value + will get capped at 5 by GC. + type: int + state: + description: + - Details about the container's current condition. + type: complex + contains: + running: + description: + - Details about a running container + type: complex + contains: + started_at: + description: + - Time at which the container was last (re-)started + type: complex + contains: {} + terminated: + description: + - Details about a terminated container + type: complex + contains: + container_id: + description: + - Container's ID in the format 'docker://' + type: str + exit_code: + description: + - Exit status from the last termination of the container + type: int + finished_at: + description: + - Time at which the container last terminated + type: complex + contains: {} + message: + description: + - Message regarding the last termination of the container + type: str + reason: + description: + - (brief) reason from the last termination of the container + type: str + signal: + description: + - Signal from the last termination of the container + type: int + started_at: + description: + - Time at which previous execution of the container started + type: complex + contains: {} + waiting: + description: + - Details about a waiting container + type: complex + contains: + message: + description: + - Message regarding why the container is not yet running. + type: str + reason: + description: + - (brief) reason the container is not yet running. + type: str + host_ip: + description: + - IP address of the host to which the pod is assigned. Empty if not + yet scheduled. + type: str + message: + description: + - A human readable message indicating details about why the pod is in + this condition. + type: str + phase: + description: + - Current condition of the pod. + type: str + pod_ip: + description: + - IP address allocated to the pod. Routable at least within the cluster. + Empty if not yet allocated. + type: str + reason: + description: + - A brief CamelCase message indicating details about why the pod is + in this state. e.g. 'OutOfDisk' + type: str + start_time: + description: + - RFC 3339 date and time at which the object was acknowledged by the + Kubelet. This is before the Kubelet pulled the container image(s) + for the pod. + type: complex + contains: {} + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_security_policy_review.py b/library/k8s_v1_pod_security_policy_review.py new file mode 100644 index 00000000..ec3de153 --- /dev/null +++ b/library/k8s_v1_pod_security_policy_review.py @@ -0,0 +1,4051 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_security_policy_review +short_description: Kubernetes PodSecurityPolicyReview +description: +- Manage the lifecycle of a pod_security_policy_review object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_service_account_names: + description: + - serviceAccountNames is an optional set of ServiceAccounts to run the check with. + If serviceAccountNames is empty, the template.spec.serviceAccountName is used, + unless it's empty, in which case "default" is used instead. If serviceAccountNames + is specified, template.spec.serviceAccountName is ignored. + aliases: + - service_account_names + type: list + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_security_policy_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + spec: + description: + - spec is the PodSecurityPolicy to check. + type: complex + contains: + service_account_names: + description: + - serviceAccountNames is an optional set of ServiceAccounts to run the check + with. If serviceAccountNames is empty, the template.spec.serviceAccountName + is used, unless it's empty, in which case "default" is used instead. If + serviceAccountNames is specified, template.spec.serviceAccountName is + ignored. + type: list + contains: str + template: + description: + - template is the PodTemplateSpec to check. The template.spec.serviceAccountName + field is used if serviceAccountNames is empty, unless the template.spec.serviceAccountName + is empty, in which case "default" is used. If serviceAccountNames is specified, + template.spec.serviceAccountName is ignored. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - status represents the current information/status for the PodSecurityPolicyReview. + type: complex + contains: + allowed_service_accounts: + description: + - allowedServiceAccounts returns the list of service accounts in *this* + namespace that have the power to create the PodTemplateSpec. + type: list + contains: + allowed_by: + description: + - allowedBy is a reference to the rule that allows the PodTemplateSpec. + A rule can be a SecurityContextConstraint or a PodSecurityPolicy A + `nil`, indicates that it was denied. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + name: + description: + - name contains the allowed and the denied ServiceAccount name + type: str + reason: + description: + - A machine-readable description of why this operation is in the "Failure" + status. If this value is empty there is no information available. + type: str + template: + description: + - template is the PodTemplateSpec after the defaulting is applied. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_security_policy_review', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_security_policy_self_subject_review.py b/library/k8s_v1_pod_security_policy_self_subject_review.py new file mode 100644 index 00000000..a1254bff --- /dev/null +++ b/library/k8s_v1_pod_security_policy_self_subject_review.py @@ -0,0 +1,3974 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_security_policy_self_subject_review +short_description: Kubernetes PodSecurityPolicySelfSubjectReview +description: +- Manage the lifecycle of a pod_security_policy_self_subject_review object. Supports + check mode, and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_security_policy_self_subject_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + spec: + description: + - spec defines specification the PodSecurityPolicySelfSubjectReview. + type: complex + contains: + template: + description: + - template is the PodTemplateSpec to check. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - status represents the current information/status for the PodSecurityPolicySelfSubjectReview. + type: complex + contains: + allowed_by: + description: + - allowedBy is a reference to the rule that allows the PodTemplateSpec. + A rule can be a SecurityContextConstraint or a PodSecurityPolicy A `nil`, + indicates that it was denied. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + reason: + description: + - A machine-readable description of why this operation is in the "Failure" + status. If this value is empty there is no information available. + type: str + template: + description: + - template is the PodTemplateSpec after the defaulting is applied. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_security_policy_self_subject_review', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_security_policy_subject_review.py b/library/k8s_v1_pod_security_policy_subject_review.py new file mode 100644 index 00000000..20517cc0 --- /dev/null +++ b/library/k8s_v1_pod_security_policy_subject_review.py @@ -0,0 +1,4001 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_security_policy_subject_review +short_description: Kubernetes PodSecurityPolicySubjectReview +description: +- Manage the lifecycle of a pod_security_policy_subject_review object. Supports check + mode, and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_groups: + description: + - groups is the groups you're testing for. + aliases: + - groups + type: list + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + spec_user: + description: + - user is the user you're testing for. If you specify "user" but not "group", + then is it interpreted as "What if user were not a member of any groups. If + user and groups are empty, then the check is performed using *only* the serviceAccountName + in the template. + aliases: + - user + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_security_policy_subject_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + spec: + description: + - spec defines specification for the PodSecurityPolicySubjectReview. + type: complex + contains: + groups: + description: + - groups is the groups you're testing for. + type: list + contains: str + template: + description: + - template is the PodTemplateSpec to check. If template.spec.serviceAccountName + is empty it will not be defaulted. If its non-empty, it will be checked. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + user: + description: + - user is the user you're testing for. If you specify "user" but not "group", + then is it interpreted as "What if user were not a member of any groups. + If user and groups are empty, then the check is performed using *only* + the serviceAccountName in the template. + type: str + status: + description: + - status represents the current information/status for the PodSecurityPolicySubjectReview. + type: complex + contains: + allowed_by: + description: + - allowedBy is a reference to the rule that allows the PodTemplateSpec. + A rule can be a SecurityContextConstraint or a PodSecurityPolicy A `nil`, + indicates that it was denied. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + reason: + description: + - A machine-readable description of why this operation is in the "Failure" + status. If this value is empty there is no information available. + type: str + template: + description: + - template is the PodTemplateSpec after the defaulting is applied. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_security_policy_subject_review', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_template.py b/library/k8s_v1_pod_template.py new file mode 100644 index 00000000..296ab3a7 --- /dev/null +++ b/library/k8s_v1_pod_template.py @@ -0,0 +1,2255 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_template +short_description: Kubernetes PodTemplate +description: +- Manage the lifecycle of a pod_template object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + template_spec_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + template_spec_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + template_spec_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + template_spec_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + template_spec_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + template_spec_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + template_spec_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + template_spec_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + template_spec_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + template_spec_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + template_spec_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + template_spec_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + template_spec_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + template_spec_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + template_spec_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + template_spec_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + template_spec_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + template_spec_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + template_spec_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + template_spec_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + template_spec_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + template_spec_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + template_spec_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + template_spec_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_template: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + template: + description: + - Template defines the pods that will be created from this pod template. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative + to StartTime before the system will actively try to mark it failed + and kill associated containers. Value must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a Pod. + Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used if\ + \ this is not provided. Variable references $(VAR_NAME) are expanded\ + \ using the container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged. The $(VAR_NAME)\ + \ syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether the\ + \ variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker image's\ + \ ENTRYPOINT is used if this is not provided. Variable references\ + \ $(VAR_NAME) are expanded using the container's environment.\ + \ If a variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can be escaped\ + \ with a double $$, ie: $$(VAR_NAME). Escaped references will\ + \ never be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the previous + defined environment variables in the container and any service + environment variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be used + if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, spec.nodeName, + spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be a valid + secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response to + container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and restarted + according to its restart policy. Other management of the container + blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. The + reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum value + is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 + seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port here + gives the system additional information about the network connections + a container uses, but is primarily informational. Not specifying + a port here DOES NOT prevent that port from being exposed. Any + port which is listening on the default "0.0.0.0" address inside + a container will be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This must + be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this must + be a valid port number, 0 < x < 65536. If HostNetwork is specified, + this must match ContainerPort. Most containers do not need + this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique within + the pod. Each named port in a pod must have a unique name. + Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot be + updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. Exec + specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the container, + the working directory for the command is root ('/') in + the container's filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum value + is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows repeated + headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults to + HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before liveness + probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to 10 + seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP hooks + not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to an + implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. Defaults + to the default set of capabilities granted by the container + runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. Default + is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin in the + container runtime. If this is not set, reads from stdin in the + container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel after + it has been opened by a single attach. When stdin is true the + stdin stream will remain open across multiple attach sessions. + If stdinOnce is set to true, stdin is opened on container start, + is empty until the first client attaches to stdin, and then remains + open and accepts data until the client disconnects, at which time + stdin is closed and remains closed until the container is restarted. + If this flag is false, a container processes that reads from stdin + will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's termination\ + \ message will be written is mounted into the container's filesystem.\ + \ Message written is intended to be brief final status, such as\ + \ an assertion failure message. Defaults to /dev/termination-log.\ + \ Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot be + updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be mounted. + Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false or + unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume should + be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured in the + container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. + If this option is set, the ports that will be used must be specified. + Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname + will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the + same namespace to use for pulling any of the images used by this PodSpec. + If specified, these secrets will be passed to individual puller implementations + for them to use. For example, in the case of docker, only DockerConfig + type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If + it is non-empty, the scheduler simply schedules this pod onto that + node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on + a node. Selector which must match a node's labels for the pod to be + scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common container + settings. Optional: Defaults to empty. See type description for default + values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1. The owning GID will\ + \ be the FSGroup 2. The setgid bit is set (new files created in\ + \ the volume will be owned by FSGroup) 3. The permission bits\ + \ are OR'd with rw-rw---- If unset, the Kubelet will not modify\ + \ the ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, + the Kubelet will validate the image at runtime to ensure that + it does not run as UID 0 (root) and fail to start the container + if it does. If unset or false, no such validation will be performed. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also be + set in SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence for that + container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context for + each container. May also be set in SecurityContext. If set in + both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each container, + in addition to the container's primary GID. If unspecified, no + groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run + this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not + have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative integer. + The value zero indicates delete immediately. If this value is nil, + the default grace period will be used instead. The grace period is + the duration in seconds after the processes running in the pod are + sent a termination signal and the time when the processes are forcibly + halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to the + pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume + /dev/sda1, you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can leave the + property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property in VolumeMounts + to "true". If omitted, the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon EBS + volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host and + bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the + ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host and + bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force the + ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account Name + and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares a pod's + lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, default + is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication secret + for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the + referenced ConfigMap will be projected into the volume as + a file whose name is the key and content is the value. If + specified, the listed keys will be projected into the specified + paths, and unlisted keys will not be present. If a key is + specified which is not present in the ConfigMap, the volume + setup will error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not + be an absolute path. May not contain the path element + '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the '..'\ + \ path. Must be utf-8 encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. The + default is "" which means to use the node's default medium. + Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to a kubelet's + host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change + in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". The + default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object containing + sensitive information to pass to the plugin scripts. This + may be empty if no secret object is specified. If the secret + object contains more than one secret, all secrets are passed + to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's host + machine. This depends on the Flocker control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the dataset + for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If omitted, + the default is to mount by volume name. Examples: For volume + /dev/sda1, you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can leave the + property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify the + disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with '..'. + If '.' is supplied, the volume directory will be the git repository. + Otherwise, if specified, the volume will contain the git repository + in the subdirectory with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the host + machine that is directly exposed to the container. This is generally + used for system agents or other privileged things that are allowed + to see the host machine. Most containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to a + kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface name\ + \ that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports 860 + and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written in + terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the '..'\ + \ path. Must be utf-8 encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources limits + and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional for + env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted with + read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to a + PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the same + namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares a pod's + lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount user + type: str + volume: + description: + - Volume is a string that references an already created Quobyte + volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that shares + a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. Tip: + Ensure that the filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. Must + be a value between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. This might + be in conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field of the + referenced Secret will be projected into the volume as a file + whose name is the key and content is the value. If specified, + the listed keys will be projected into the specified paths, + and unlisted keys will not be present. If a key is specified + which is not present in the Secret, the volume setup will + error. Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be a value + between 0 and 0777. If not specified, the volume defaultMode + will be used. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. May not + be an absolute path. May not contain the path element + '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_template', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_pod_template_list.py b/library/k8s_v1_pod_template_list.py new file mode 100644 index 00000000..6cb17fda --- /dev/null +++ b/library/k8s_v1_pod_template_list.py @@ -0,0 +1,2121 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_pod_template_list +short_description: Kubernetes PodTemplateList +description: +- Retrieve a list of pod_templates. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_template_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of pod templates + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + template: + description: + - Template defines the pods that will be created from this pod template. + http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_template_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_policy.py b/library/k8s_v1_policy.py new file mode 100644 index 00000000..a403dd42 --- /dev/null +++ b/library/k8s_v1_policy.py @@ -0,0 +1,540 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_policy +short_description: Kubernetes Policy +description: +- Manage the lifecycle of a policy object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + roles: + description: + - Roles holds all the Roles held by this Policy, mapped by Role.Name + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +policy: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the Policy was created, updated, + or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + roles: + description: + - Roles holds all the Roles held by this Policy, mapped by Role.Name + type: list + contains: + name: + description: + - Name is the name of the role + type: str + role: + description: + - Role is the role being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this Role + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against + one of the enumerated resources in either the kubernetes or the + origin API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should + have access to. *s are allowed, but only as the full, final step + in the path This name is intentionally different than the internal + type so that the DefaultConvert works nicely and because the ordering + may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule + applies to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and + AttributeRestrictions contained in this rule. VerbAll represents + all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('policy', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_policy_binding.py b/library/k8s_v1_policy_binding.py new file mode 100644 index 00000000..1bc6c345 --- /dev/null +++ b/library/k8s_v1_policy_binding.py @@ -0,0 +1,676 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_policy_binding +short_description: Kubernetes PolicyBinding +description: +- Manage the lifecycle of a policy_binding object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + policy_ref_api_version: + description: + - API version of the referent. + aliases: + - api_version + policy_ref_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + policy_ref_kind: + description: + - Kind of the referent. + aliases: + - kind + policy_ref_name: + description: + - Name of the referent. + aliases: + - name + policy_ref_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + policy_ref_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + policy_ref_uid: + description: + - UID of the referent. + aliases: + - uid + role_bindings: + description: + - RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped by + RoleBinding.Name + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +policy_binding: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the PolicyBinding was created, + updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + policy_ref: + description: + - PolicyRef is a reference to the Policy that contains all the Roles that this + PolicyBinding's RoleBindings may reference + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + role_bindings: + description: + - RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped + by RoleBinding.Name + type: list + contains: + name: + description: + - Name is the name of the role binding + type: str + role_binding: + description: + - RoleBinding is the role binding being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field + should only be specified when supporting legacy clients and servers. + See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the RoleRef cannot be resolved, the Authorizer must return an error. + Since Policy is a singleton, this is sufficient knowledge to locate + a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This + field is ignored if UserNames or GroupNames are specified to support + legacy clients and servers. Thus newer clients that do not need to + support backwards compatibility should send only fully qualified Subjects + and should omit the UserNames and GroupNames fields. Clients that + need to support backwards compatibility can use this field to build + the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This + field should only be specified when supporting legacy clients and + servers. See Subjects for further details. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('policy_binding', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_policy_binding_list.py b/library/k8s_v1_policy_binding_list.py new file mode 100644 index 00000000..47cb5078 --- /dev/null +++ b/library/k8s_v1_policy_binding_list.py @@ -0,0 +1,663 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_policy_binding_list +short_description: Kubernetes PolicyBindingList +description: +- Retrieve a list of policy_bindings. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +policy_binding_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of PolicyBindings + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the PolicyBinding was created, + updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + policy_ref: + description: + - PolicyRef is a reference to the Policy that contains all the Roles that + this PolicyBinding's RoleBindings may reference + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + role_bindings: + description: + - RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped + by RoleBinding.Name + type: list + contains: + name: + description: + - Name is the name of the role binding + type: str + role_binding: + description: + - RoleBinding is the role binding being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This + field should only be specified when supporting legacy clients + and servers. See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global + namespace. If the RoleRef cannot be resolved, the Authorizer must + return an error. Since Policy is a singleton, this is sufficient + knowledge to locate a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This + field is ignored if UserNames or GroupNames are specified to support + legacy clients and servers. Thus newer clients that do not need + to support backwards compatibility should send only fully qualified + Subjects and should omit the UserNames and GroupNames fields. + Clients that need to support backwards compatibility can use this + field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire + object, this string should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, + if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. + This field should only be specified when supporting legacy clients + and servers. See Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('policy_binding_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_policy_list.py b/library/k8s_v1_policy_list.py new file mode 100644 index 00000000..1d1bea5d --- /dev/null +++ b/library/k8s_v1_policy_list.py @@ -0,0 +1,565 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_policy_list +short_description: Kubernetes PolicyList +description: +- Retrieve a list of policys. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +policy_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of Policies + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + last_modified: + description: + - LastModified is the last time that any part of the Policy was created, + updated, or deleted + type: complex + contains: {} + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + roles: + description: + - Roles holds all the Roles held by this Policy, mapped by Role.Name + type: list + contains: + name: + description: + - Name is the name of the role + type: str + role: + description: + - Role is the role being named + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this Role + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API + groups are assumed. That means that if an action is requested + against one of the enumerated resources in either the kubernetes + or the origin API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to + handle the AttributeRestrictions, the Authorizer should report + an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user + should have access to. *s are allowed, but only as the full, + final step in the path This name is intentionally different + than the internal type so that the DefaultConvert works nicely + and because the ordering may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the + rule applies to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds + and AttributeRestrictions contained in this rule. VerbAll + represents all kinds. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('policy_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_project.py b/library/k8s_v1_project.py new file mode 100644 index 00000000..db9be926 --- /dev/null +++ b/library/k8s_v1_project.py @@ -0,0 +1,331 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_project +short_description: Kubernetes Project +description: +- Manage the lifecycle of a project object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + description: + description: + - Provides a brief overview or narrative for the project. + display_name: + description: + - Provides a descriptive name for the project. + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently remove + object from storage + aliases: + - finalizers + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +- name: Create project + k8s_v1_project: + name: example + state: present + +- name: Remove project + k8s_v1_project: + name: example + state: absent +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +project: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the behavior of the Namespace. + type: complex + contains: + finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently + remove object from storage + type: list + contains: str + status: + description: + - Status describes the current status of a Namespace + type: complex + contains: + phase: + description: + - Phase is the current lifecycle phase of the project + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('project', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_project_list.py b/library/k8s_v1_project_list.py new file mode 100644 index 00000000..7fa18796 --- /dev/null +++ b/library/k8s_v1_project_list.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_project_list +short_description: Kubernetes ProjectList +description: +- Retrieve a list of projects. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +project_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of projects + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the behavior of the Namespace. + type: complex + contains: + finalizers: + description: + - Finalizers is an opaque list of values that must be empty to permanently + remove object from storage + type: list + contains: str + status: + description: + - Status describes the current status of a Namespace + type: complex + contains: + phase: + description: + - Phase is the current lifecycle phase of the project + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('project_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_replication_controller.py b/library/k8s_v1_replication_controller.py new file mode 100644 index 00000000..e231d999 --- /dev/null +++ b/library/k8s_v1_replication_controller.py @@ -0,0 +1,2403 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_replication_controller +short_description: Kubernetes ReplicationController +description: +- Manage the lifecycle of a replication_controller object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready without + any of its container crashing, for it to be considered available. Defaults to + 0 (pod will be considered available as soon as it is ready) + aliases: + - min_ready_seconds + type: int + spec_replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + aliases: + - replicas + type: int + spec_selector: + description: + - Selector is a label query over pods that should match the Replicas count. If + Selector is empty, it is defaulted to the labels present on the Pod template. + Label keys and values that must match in order to be controlled by this replication + controller, if empty defaulted to labels on Pod template. + aliases: + - selector + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +replication_controller: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - If the Labels of a ReplicationController are empty, they are defaulted to + be the same as the Pod(s) that the replication controller manages. Standard + object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the specification of the desired behavior of the replication + controller. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready + without any of its container crashing, for it to be considered available. + Defaults to 0 (pod will be considered available as soon as it is ready) + type: int + replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the Replicas count. + If Selector is empty, it is defaulted to the labels present on the Pod + template. Label keys and values that must match in order to be controlled + by this replication controller, if empty defaulted to labels on Pod template. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created if + insufficient replicas are detected. This takes precedence over a TemplateRef. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the most recently observed status of the replication controller. + This data may be out of date by some window of time. Populated by the system. + Read-only. + type: complex + contains: + available_replicas: + description: + - The number of available replicas (ready for at least minReadySeconds) + for this replication controller. + type: int + conditions: + description: + - Represents the latest available observations of a replication controller's + current state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of replication controller condition. + type: str + fully_labeled_replicas: + description: + - The number of pods that have labels matching the labels of the pod template + of the replication controller. + type: int + observed_generation: + description: + - ObservedGeneration reflects the generation of the most recently observed + replication controller. + type: int + ready_replicas: + description: + - The number of ready replicas for this replication controller. + type: int + replicas: + description: + - Replicas is the most recently oberved number of replicas. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('replication_controller', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_replication_controller_list.py b/library/k8s_v1_replication_controller_list.py new file mode 100644 index 00000000..ad6cfb2c --- /dev/null +++ b/library/k8s_v1_replication_controller_list.py @@ -0,0 +1,2254 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_replication_controller_list +short_description: Kubernetes ReplicationControllerList +description: +- Retrieve a list of replication_controllers. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +replication_controller_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of replication controllers. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - If the Labels of a ReplicationController are empty, they are defaulted + to be the same as the Pod(s) that the replication controller manages. + Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the specification of the desired behavior of the replication + controller. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be + ready without any of its container crashing, for it to be considered + available. Defaults to 0 (pod will be considered available as soon + as it is ready) + type: int + replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the Replicas + count. If Selector is empty, it is defaulted to the labels present + on the Pod template. Label keys and values that must match in order + to be controlled by this replication controller, if empty defaulted + to labels on Pod template. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + if insufficient replicas are detected. This takes precedence over + a TemplateRef. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the most recently observed status of the replication controller. + This data may be out of date by some window of time. Populated by the + system. Read-only. + type: complex + contains: + available_replicas: + description: + - The number of available replicas (ready for at least minReadySeconds) + for this replication controller. + type: int + conditions: + description: + - Represents the latest available observations of a replication controller's + current state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of replication controller condition. + type: str + fully_labeled_replicas: + description: + - The number of pods that have labels matching the labels of the pod + template of the replication controller. + type: int + observed_generation: + description: + - ObservedGeneration reflects the generation of the most recently observed + replication controller. + type: int + ready_replicas: + description: + - The number of ready replicas for this replication controller. + type: int + replicas: + description: + - Replicas is the most recently oberved number of replicas. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('replication_controller_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_resource_quota.py b/library/k8s_v1_resource_quota.py new file mode 100644 index 00000000..af89dc60 --- /dev/null +++ b/library/k8s_v1_resource_quota.py @@ -0,0 +1,333 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_resource_quota +short_description: Kubernetes ResourceQuota +description: +- Manage the lifecycle of a resource_quota object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_hard: + description: + - Hard is the set of desired hard limits for each named resource. + aliases: + - hard + type: dict + spec_scopes: + description: + - A collection of filters that must match each object tracked by a quota. If not + specified, the quota matches all objects. + aliases: + - scopes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +resource_quota: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired quota. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by a quota. + If not specified, the quota matches all objects. + type: list + contains: str + status: + description: + - Status defines the actual enforced quota and its current usage. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the namespace. + type: complex + contains: str, ResourceQuantity +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('resource_quota', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_resource_quota_list.py b/library/k8s_v1_resource_quota_list.py new file mode 100644 index 00000000..8a180bf9 --- /dev/null +++ b/library/k8s_v1_resource_quota_list.py @@ -0,0 +1,341 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_resource_quota_list +short_description: Kubernetes ResourceQuotaList +description: +- Retrieve a list of resource_quotas. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +resource_quota_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of ResourceQuota objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired quota. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + hard: + description: + - Hard is the set of desired hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + scopes: + description: + - A collection of filters that must match each object tracked by a quota. + If not specified, the quota matches all objects. + type: list + contains: str + status: + description: + - Status defines the actual enforced quota and its current usage. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + hard: + description: + - Hard is the set of enforced hard limits for each named resource. + type: complex + contains: str, ResourceQuantity + used: + description: + - Used is the current observed total usage of the resource in the namespace. + type: complex + contains: str, ResourceQuantity + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('resource_quota_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role.py b/library/k8s_v1_role.py new file mode 100644 index 00000000..612cec86 --- /dev/null +++ b/library/k8s_v1_role.py @@ -0,0 +1,344 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role +short_description: Kubernetes Role +description: +- Manage the lifecycle of a role object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + rules: + description: + - Rules holds all the PolicyRules for this Role + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this Role + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. If + this field is empty, then both kubernetes and origin API groups are assumed. + That means that if an action is requested against one of the enumerated + resources in either the kubernetes or the origin API group, the request + will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle the + AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the path + This name is intentionally different than the internal type so that the + DefaultConvert works nicely and because the ordering may be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll represents + all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role_binding.py b/library/k8s_v1_role_binding.py new file mode 100644 index 00000000..0185d616 --- /dev/null +++ b/library/k8s_v1_role_binding.py @@ -0,0 +1,452 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role_binding +short_description: Kubernetes RoleBinding +description: +- Manage the lifecycle of a role_binding object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects for + further details. + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + role_ref_api_version: + description: + - API version of the referent. + aliases: + - api_version + role_ref_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + role_ref_kind: + description: + - Kind of the referent. + aliases: + - kind + role_ref_name: + description: + - Name of the referent. + aliases: + - name + role_ref_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + role_ref_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + role_ref_uid: + description: + - UID of the referent. + aliases: + - uid + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + subjects: + description: + - Subjects hold object references to authorize with this rule. This field is ignored + if UserNames or GroupNames are specified to support legacy clients and servers. + Thus newer clients that do not need to support backwards compatibility should + send only fully qualified Subjects and should omit the UserNames and GroupNames + fields. Clients that need to support backwards compatibility can use this field + to build the UserNames and GroupNames. + type: list + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects for + further details. + type: list + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role_binding: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects + for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the RoleRef cannot be resolved, the Authorizer must return an error. Since + Policy is a singleton, this is sufficient knowledge to locate a role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This field is + ignored if UserNames or GroupNames are specified to support legacy clients + and servers. Thus newer clients that do not need to support backwards compatibility + should send only fully qualified Subjects and should omit the UserNames and + GroupNames fields. Clients that need to support backwards compatibility can + use this field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field should + only be specified when supporting legacy clients and servers. See Subjects + for further details. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role_binding', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role_binding_list.py b/library/k8s_v1_role_binding_list.py new file mode 100644 index 00000000..24eff2b5 --- /dev/null +++ b/library/k8s_v1_role_binding_list.py @@ -0,0 +1,414 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role_binding_list +short_description: Kubernetes RoleBindingList +description: +- Retrieve a list of role_bindings. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role_binding_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of RoleBindings + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + group_names: + description: + - GroupNames holds all the groups directly bound to the role. This field + should only be specified when supporting legacy clients and servers. See + Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + role_ref: + description: + - RoleRef can only reference the current namespace and the global namespace. + If the RoleRef cannot be resolved, the Authorizer must return an error. + Since Policy is a singleton, this is sufficient knowledge to locate a + role. + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + subjects: + description: + - Subjects hold object references to authorize with this rule. This field + is ignored if UserNames or GroupNames are specified to support legacy + clients and servers. Thus newer clients that do not need to support backwards + compatibility should send only fully qualified Subjects and should omit + the UserNames and GroupNames fields. Clients that need to support backwards + compatibility can use this field to build the UserNames and GroupNames. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + user_names: + description: + - UserNames holds all the usernames directly bound to the role. This field + should only be specified when supporting legacy clients and servers. See + Subjects for further details. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role_binding_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role_binding_restriction.py b/library/k8s_v1_role_binding_restriction.py new file mode 100644 index 00000000..6714d91f --- /dev/null +++ b/library/k8s_v1_role_binding_restriction.py @@ -0,0 +1,463 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role_binding_restriction +short_description: Kubernetes RoleBindingRestriction +description: +- Manage the lifecycle of a role_binding_restriction object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_grouprestriction_groups: + description: + - Groups is a list of groups used to match against an individual user's groups. + If the user is a member of one of the whitelisted groups, the user is allowed + to be bound to a role. + aliases: + - grouprestriction_groups + type: list + spec_grouprestriction_labels: + description: + - Selectors specifies a list of label selectors over group labels. + aliases: + - grouprestriction_labels + type: list + spec_serviceaccountrestriction_namespaces: + description: + - Namespaces specifies a list of literal namespace names. + aliases: + - serviceaccountrestriction_namespaces + type: list + spec_serviceaccountrestriction_serviceaccounts: + description: + - ServiceAccounts specifies a list of literal service-account names. + aliases: + - serviceaccountrestriction_serviceaccounts + type: list + spec_userrestriction_groups: + description: + - Groups specifies a list of literal group names. + aliases: + - userrestriction_groups + type: list + spec_userrestriction_labels: + description: + - Selectors specifies a list of label selectors over user labels. + aliases: + - userrestriction_labels + type: list + spec_userrestriction_users: + description: + - Users specifies a list of literal user names. + aliases: + - userrestriction_users + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role_binding_restriction: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the matcher. + type: complex + contains: + grouprestriction: + description: + - GroupRestriction matches against group subjects. + type: complex + contains: + groups: + description: + - Groups is a list of groups used to match against an individual user's + groups. If the user is a member of one of the whitelisted groups, + the user is allowed to be bound to a role. + type: list + contains: str + labels: + description: + - Selectors specifies a list of label selectors over group labels. + type: list + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + serviceaccountrestriction: + description: + - ServiceAccountRestriction matches against service-account subjects. + type: complex + contains: + namespaces: + description: + - Namespaces specifies a list of literal namespace names. + type: list + contains: str + serviceaccounts: + description: + - ServiceAccounts specifies a list of literal service-account names. + type: list + contains: + name: + description: + - Name is the name of the service account. + type: str + namespace: + description: + - Namespace is the namespace of the service account. Service accounts + from inside the whitelisted namespaces are allowed to be bound + to roles. If Namespace is empty, then the namespace of the RoleBindingRestriction + in which the ServiceAccountReference is embedded is used. + type: str + userrestriction: + description: + - UserRestriction matches against user subjects. + type: complex + contains: + groups: + description: + - Groups specifies a list of literal group names. + type: list + contains: str + labels: + description: + - Selectors specifies a list of label selectors over user labels. + type: list + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + users: + description: + - Users specifies a list of literal user names. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role_binding_restriction', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role_binding_restriction_list.py b/library/k8s_v1_role_binding_restriction_list.py new file mode 100644 index 00000000..062efc09 --- /dev/null +++ b/library/k8s_v1_role_binding_restriction_list.py @@ -0,0 +1,443 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role_binding_restriction_list +short_description: Kubernetes RoleBindingRestrictionList +description: +- Retrieve a list of role_binding_restrictions. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role_binding_restriction_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of RoleBindingRestriction objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the matcher. + type: complex + contains: + grouprestriction: + description: + - GroupRestriction matches against group subjects. + type: complex + contains: + groups: + description: + - Groups is a list of groups used to match against an individual + user's groups. If the user is a member of one of the whitelisted + groups, the user is allowed to be bound to a role. + type: list + contains: str + labels: + description: + - Selectors specifies a list of label selectors over group labels. + type: list + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + serviceaccountrestriction: + description: + - ServiceAccountRestriction matches against service-account subjects. + type: complex + contains: + namespaces: + description: + - Namespaces specifies a list of literal namespace names. + type: list + contains: str + serviceaccounts: + description: + - ServiceAccounts specifies a list of literal service-account names. + type: list + contains: + name: + description: + - Name is the name of the service account. + type: str + namespace: + description: + - Namespace is the namespace of the service account. Service + accounts from inside the whitelisted namespaces are allowed + to be bound to roles. If Namespace is empty, then the namespace + of the RoleBindingRestriction in which the ServiceAccountReference + is embedded is used. + type: str + userrestriction: + description: + - UserRestriction matches against user subjects. + type: complex + contains: + groups: + description: + - Groups specifies a list of literal group names. + type: list + contains: str + labels: + description: + - Selectors specifies a list of label selectors over user labels. + type: list + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + users: + description: + - Users specifies a list of literal user names. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role_binding_restriction_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_role_list.py b/library/k8s_v1_role_list.py new file mode 100644 index 00000000..96fc4d30 --- /dev/null +++ b/library/k8s_v1_role_list.py @@ -0,0 +1,362 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_role_list +short_description: Kubernetes RoleList +description: +- Retrieve a list of roles. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +role_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of Roles + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + rules: + description: + - Rules holds all the PolicyRules for this Role + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against one + of the enumerated resources in either the kubernetes or the origin + API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the + path This name is intentionally different than the internal type so + that the DefaultConvert works nicely and because the ordering may + be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('role_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_route.py b/library/k8s_v1_route.py new file mode 100644 index 00000000..a01ba361 --- /dev/null +++ b/library/k8s_v1_route.py @@ -0,0 +1,613 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_route +short_description: Kubernetes Route +description: +- Manage the lifecycle of a route object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_alternate_backends: + description: + - alternateBackends is an extension of the 'to' field. If more than one service + needs to be pointed to, then use this field. Use the weight field in RouteTargetReference + object to specify relative preference. If the weight field is zero, the backend + is ignored. + aliases: + - alternate_backends + type: list + spec_host: + description: + - host is an alias/DNS that points to the service. Optional. If not specified + a route name will typically be automatically chosen. Must follow DNS952 subdomain + conventions. + aliases: + - host + spec_path: + description: + - Path that the router watches for, to route traffic for to the service. Optional + aliases: + - path + spec_tls_ca_certificate: + description: + - caCertificate provides the cert authority certificate contents + aliases: + - tls_ca_certificate + spec_tls_certificate: + description: + - certificate provides certificate contents + aliases: + - tls_certificate + spec_tls_destination_ca_certificate: + description: + - destinationCACertificate provides the contents of the ca certificate of the + final destination. When using reencrypt termination this file should be provided + in order to have routers use it for health checks on the secure connection + aliases: + - tls_destination_ca_certificate + spec_tls_insecure_edge_termination_policy: + description: + - insecureEdgeTerminationPolicy indicates the desired behavior for insecure connections + to a route. While each router may make its own decisions on which ports to expose, + this is normally port 80. * Allow - traffic is sent to the server on the insecure + port (default) * Disable - no traffic is allowed on the insecure port. * Redirect + - clients are redirected to the secure port. + aliases: + - tls_insecure_edge_termination_policy + spec_tls_key: + description: + - key provides key file contents + aliases: + - tls_key + spec_tls_termination: + description: + - termination indicates termination type. + aliases: + - tls_termination + spec_to_kind: + description: + - The kind of target that the route is referring to. Currently, only 'Service' + is allowed + aliases: + - to_kind + spec_to_name: + description: + - name of the service/target that is being referred to. e.g. name of the service + aliases: + - to_name + spec_to_weight: + description: + - weight as an integer between 1 and 256 that specifies the target's relative + weight against other target reference objects + aliases: + - to_weight + type: int + spec_wildcard_policy: + description: + - Wildcard policy if any for the route. Currently only 'Subdomain' or 'None' is + allowed. + aliases: + - wildcard_policy + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +- name: Create route + k8s_v1_route: + name: myroute + namespace: k8s-project + state: present + host: www.example.com + target_reference_kind: Service + target_reference_name: service-name + tls_termination: edge + tls_key: |- + -----BEGIN PRIVATE KEY----- + asjdflajd0fjasldjflsjflkjlkjfaljsdfljasljflasjfljsdf + sdlfjalsdjfljasdfljsljfljsfljdf + -----END PRIVATE KEY----- + tls_certificate: |- + -----BEGIN CERTIFICATE----- + kdlslfsfljetuoeiursljflsdjffljsfsf90909wrjf94lsjdf99KK + -----END CERTIFICATE----- + tls_ca_certificate: |- + -----BEGIN CERTIFICATE----- + asdfajflasfjfsljlrjlrjlsjfoijlsornkvksflsbgoehfflf54444 + -----END CERTIFICATE----- + +- name: Patch route + k8s_v1_route: + name: myroute + namespace: k8s-project + state: present + host: www.example.com + tls_termination: reencrypt + target_reference_kind: Service + target_reference_name: other-service-name + tls_destination_ca_certificate: |- + -----BEGIN CERTIFICATE----- + destination cetricate_contents + -----END CERTIFICATE----- + +- name: Replace route + k8s_v1_route: + name: myroute + namespace: k8s-project + state: replaced + host: www.example.com + path: /foo/bar/baz.html + target_reference_kind: Service + target_reference_name: whimsy-name + tls_termination: edge + tls_key: |- + -----BEGIN PRIVATE KEY----- + key_file_contents + -----END PRIVATE KEY----- + tls_certificate: |- + -----BEGIN CERTIFICATE----- + certificate_contents + -----END CERTIFICATE----- + tls_ca_certificate: |- + -----BEGIN CERTIFICATE----- + ca_certificate_contents + -----END CERTIFICATE----- + +- name: Remove route + k8s_v1_route: + name: myroute + namespace: k8s-project + state: absent +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +route: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - spec is the desired state of the route + type: complex + contains: + alternate_backends: + description: + - alternateBackends is an extension of the 'to' field. If more than one + service needs to be pointed to, then use this field. Use the weight field + in RouteTargetReference object to specify relative preference. If the + weight field is zero, the backend is ignored. + type: list + contains: + kind: + description: + - The kind of target that the route is referring to. Currently, only + 'Service' is allowed + type: str + name: + description: + - name of the service/target that is being referred to. e.g. name of + the service + type: str + weight: + description: + - weight as an integer between 1 and 256 that specifies the target's + relative weight against other target reference objects + type: int + host: + description: + - host is an alias/DNS that points to the service. Optional. If not specified + a route name will typically be automatically chosen. Must follow DNS952 + subdomain conventions. + type: str + path: + description: + - Path that the router watches for, to route traffic for to the service. + Optional + type: str + port: + description: + - If specified, the port to be used by the router. Most routers will use + all endpoints exposed by the service by default - set this value to instruct + routers which port to use. + type: complex + contains: + target_port: + description: + - The target port on pods selected by the service this route points + to. If this is a string, it will be looked up as a named port in the + target endpoints port list. Required + type: complex + contains: {} + tls: + description: + - The tls field provides the ability to configure certificates and termination + for the route. + type: complex + contains: + ca_certificate: + description: + - caCertificate provides the cert authority certificate contents + type: str + certificate: + description: + - certificate provides certificate contents + type: str + destination_ca_certificate: + description: + - destinationCACertificate provides the contents of the ca certificate + of the final destination. When using reencrypt termination this file + should be provided in order to have routers use it for health checks + on the secure connection + type: str + insecure_edge_termination_policy: + description: + - insecureEdgeTerminationPolicy indicates the desired behavior for insecure + connections to a route. While each router may make its own decisions + on which ports to expose, this is normally port 80. * Allow - traffic + is sent to the server on the insecure port (default) * Disable - no + traffic is allowed on the insecure port. * Redirect - clients are + redirected to the secure port. + type: str + key: + description: + - key provides key file contents + type: str + termination: + description: + - termination indicates termination type. + type: str + to: + description: + - to is an object the route should use as the primary backend. Only the + Service kind is allowed, and it will be defaulted to Service. If the weight + field is set to zero, no traffic will be sent to this service. + type: complex + contains: + kind: + description: + - The kind of target that the route is referring to. Currently, only + 'Service' is allowed + type: str + name: + description: + - name of the service/target that is being referred to. e.g. name of + the service + type: str + weight: + description: + - weight as an integer between 1 and 256 that specifies the target's + relative weight against other target reference objects + type: int + wildcard_policy: + description: + - Wildcard policy if any for the route. Currently only 'Subdomain' or 'None' + is allowed. + type: str + status: + description: + - status is the current state of the route + type: complex + contains: + ingress: + description: + - ingress describes the places where the route may be exposed. The list + of ingress points may contain duplicate Host or RouterName values. Routes + are considered live once they are `Ready` + type: list + contains: + conditions: + description: + - Conditions is the state of the route, may be empty. + type: list + contains: + last_transition_time: + description: + - RFC 3339 date and time when this condition last transitioned + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition, and is usually + a machine and human readable constant + type: str + status: + description: + - Status is the status of the condition. Can be True, False, Unknown. + type: str + type: + description: + - Type is the type of the condition. Currently only Ready. + type: str + host: + description: + - Host is the host string under which the route is exposed; this value + is required + type: str + router_canonical_hostname: + description: + - CanonicalHostname is the external host name for the router that can + be used as a CNAME for the host requested for this route. This value + is optional and may not be set in all cases. + type: str + router_name: + description: + - Name is a name chosen by the router to identify itself; this value + is required + type: str + wildcard_policy: + description: + - Wildcard policy is the wildcard policy that was allowed where this + route is exposed. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('route', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_route_list.py b/library/k8s_v1_route_list.py new file mode 100644 index 00000000..4dcb77f5 --- /dev/null +++ b/library/k8s_v1_route_list.py @@ -0,0 +1,490 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_route_list +short_description: Kubernetes RouteList +description: +- Retrieve a list of routes. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +route_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - items is a list of routes + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - spec is the desired state of the route + type: complex + contains: + alternate_backends: + description: + - alternateBackends is an extension of the 'to' field. If more than + one service needs to be pointed to, then use this field. Use the weight + field in RouteTargetReference object to specify relative preference. + If the weight field is zero, the backend is ignored. + type: list + contains: + kind: + description: + - The kind of target that the route is referring to. Currently, + only 'Service' is allowed + type: str + name: + description: + - name of the service/target that is being referred to. e.g. name + of the service + type: str + weight: + description: + - weight as an integer between 1 and 256 that specifies the target's + relative weight against other target reference objects + type: int + host: + description: + - host is an alias/DNS that points to the service. Optional. If not + specified a route name will typically be automatically chosen. Must + follow DNS952 subdomain conventions. + type: str + path: + description: + - Path that the router watches for, to route traffic for to the service. + Optional + type: str + port: + description: + - If specified, the port to be used by the router. Most routers will + use all endpoints exposed by the service by default - set this value + to instruct routers which port to use. + type: complex + contains: + target_port: + description: + - The target port on pods selected by the service this route points + to. If this is a string, it will be looked up as a named port + in the target endpoints port list. Required + type: complex + contains: {} + tls: + description: + - The tls field provides the ability to configure certificates and termination + for the route. + type: complex + contains: + ca_certificate: + description: + - caCertificate provides the cert authority certificate contents + type: str + certificate: + description: + - certificate provides certificate contents + type: str + destination_ca_certificate: + description: + - destinationCACertificate provides the contents of the ca certificate + of the final destination. When using reencrypt termination this + file should be provided in order to have routers use it for health + checks on the secure connection + type: str + insecure_edge_termination_policy: + description: + - insecureEdgeTerminationPolicy indicates the desired behavior for + insecure connections to a route. While each router may make its + own decisions on which ports to expose, this is normally port + 80. * Allow - traffic is sent to the server on the insecure port + (default) * Disable - no traffic is allowed on the insecure port. + * Redirect - clients are redirected to the secure port. + type: str + key: + description: + - key provides key file contents + type: str + termination: + description: + - termination indicates termination type. + type: str + to: + description: + - to is an object the route should use as the primary backend. Only + the Service kind is allowed, and it will be defaulted to Service. + If the weight field is set to zero, no traffic will be sent to this + service. + type: complex + contains: + kind: + description: + - The kind of target that the route is referring to. Currently, + only 'Service' is allowed + type: str + name: + description: + - name of the service/target that is being referred to. e.g. name + of the service + type: str + weight: + description: + - weight as an integer between 1 and 256 that specifies the target's + relative weight against other target reference objects + type: int + wildcard_policy: + description: + - Wildcard policy if any for the route. Currently only 'Subdomain' or + 'None' is allowed. + type: str + status: + description: + - status is the current state of the route + type: complex + contains: + ingress: + description: + - ingress describes the places where the route may be exposed. The list + of ingress points may contain duplicate Host or RouterName values. + Routes are considered live once they are `Ready` + type: list + contains: + conditions: + description: + - Conditions is the state of the route, may be empty. + type: list + contains: + last_transition_time: + description: + - RFC 3339 date and time when this condition last transitioned + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition, and is + usually a machine and human readable constant + type: str + status: + description: + - Status is the status of the condition. Can be True, False, + Unknown. + type: str + type: + description: + - Type is the type of the condition. Currently only Ready. + type: str + host: + description: + - Host is the host string under which the route is exposed; this + value is required + type: str + router_canonical_hostname: + description: + - CanonicalHostname is the external host name for the router that + can be used as a CNAME for the host requested for this route. + This value is optional and may not be set in all cases. + type: str + router_name: + description: + - Name is a name chosen by the router to identify itself; this value + is required + type: str + wildcard_policy: + description: + - Wildcard policy is the wildcard policy that was allowed where + this route is exposed. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('route_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_scale.py b/library/k8s_v1_scale.py new file mode 100644 index 00000000..da363c8c --- /dev/null +++ b/library/k8s_v1_scale.py @@ -0,0 +1,308 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_scale +short_description: Kubernetes Scale +description: +- Manage the lifecycle of a scale object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_replicas: + description: + - desired number of instances for the scaled object. + aliases: + - replicas + type: int + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +scale: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata; + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - defines the behavior of the scale. + type: complex + contains: + replicas: + description: + - desired number of instances for the scaled object. + type: int + status: + description: + - current status of the scale. + type: complex + contains: + replicas: + description: + - actual number of observed instances of the scaled object. + type: int + selector: + description: + - 'label query over pods that should match the replicas count. This is same + as the label selector but in the string format to avoid introspection + by clients. The string will be in the same format as the query-param syntax. + More info about label selectors: http://kubernetes.io/docs/user-guide/labels' + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('scale', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_secret.py b/library/k8s_v1_secret.py new file mode 100644 index 00000000..c32f9b3c --- /dev/null +++ b/library/k8s_v1_secret.py @@ -0,0 +1,326 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_secret +short_description: Kubernetes Secret +description: +- Manage the lifecycle of a secret object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + data: + description: + - Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading + dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data + is a base64 encoded string, representing the arbitrary (possibly non-string) + data value here. Described in + type: dict + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + string_data: + description: + - stringData allows specifying non-binary secret data in string form. It is provided + as a write-only convenience method. All keys and values are merged into the + data field on write, overwriting any existing values. It is never output when + reading from the API. + type: dict + type: + description: + - Used to facilitate programmatic handling of secret data. + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +secret: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + data: + description: + - Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading + dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data + is a base64 encoded string, representing the arbitrary (possibly non-string) + data value here. Described in + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + string_data: + description: + - stringData allows specifying non-binary secret data in string form. It is + provided as a write-only convenience method. All keys and values are merged + into the data field on write, overwriting any existing values. It is never + output when reading from the API. + type: complex + contains: str, str + type: + description: + - Used to facilitate programmatic handling of secret data. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('secret', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_secret_list.py b/library/k8s_v1_secret_list.py new file mode 100644 index 00000000..5427dc36 --- /dev/null +++ b/library/k8s_v1_secret_list.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_secret_list +short_description: Kubernetes SecretList +description: +- Retrieve a list of secrets. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +secret_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of secret objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + data: + description: + - Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN + or leading dot followed by valid DNS_SUBDOMAIN. The serialized form of + the secret data is a base64 encoded string, representing the arbitrary + (possibly non-string) data value here. Described in + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + string_data: + description: + - stringData allows specifying non-binary secret data in string form. It + is provided as a write-only convenience method. All keys and values are + merged into the data field on write, overwriting any existing values. + It is never output when reading from the API. + type: complex + contains: str, str + type: + description: + - Used to facilitate programmatic handling of secret data. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('secret_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_security_context_constraints.py b/library/k8s_v1_security_context_constraints.py new file mode 100644 index 00000000..3e912893 --- /dev/null +++ b/library/k8s_v1_security_context_constraints.py @@ -0,0 +1,638 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_security_context_constraints +short_description: Kubernetes SecurityContextConstraints +description: +- Manage the lifecycle of a security_context_constraints object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + allow_host_dir_volume_plugin: + description: + - AllowHostDirVolumePlugin determines if the policy allow containers to use the + HostDir volume plugin + type: bool + allow_host_ipc: + description: + - AllowHostIPC determines if the policy allows host ipc in the containers. + type: bool + allow_host_network: + description: + - AllowHostNetwork determines if the policy allows the use of HostNetwork in the + pod spec. + type: bool + allow_host_pid: + description: + - AllowHostPID determines if the policy allows host pid in the containers. + type: bool + allow_host_ports: + description: + - AllowHostPorts determines if the policy allows host ports in the containers. + type: bool + allow_privileged_container: + description: + - AllowPrivilegedContainer determines if a container can request to be run as + privileged. + type: bool + allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested to add to + the container. Capabilities in this field maybe added at the pod author's discretion. + You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. + type: list + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will be added + to the container unless the pod spec specifically drops the capability. You + may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities. + type: list + fs_group_ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like to force a single + fs group then supply a single range with the same start and end. + aliases: + - ranges + type: list + fs_group_type: + description: + - Type is the strategy that will dictate what FSGroup is used in the SecurityContext. + aliases: + - type + groups: + description: + - The groups that have permission to use this security context constraints + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + priority: + description: + - Priority influences the sort order of SCCs when evaluating which SCCs to try + first for a given pod request based on access in the Users and Groups fields. + The higher the int, the higher priority. If scores for multiple SCCs are equal + they will be sorted by name. + type: int + read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run with a + read only root file system. If the container specifically requests to run with + a non-read only root file system the SCC should deny the pod. If set to false + the container may run with a read only root file system if it wishes but it + will not be forced to. + type: bool + required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped from the + container. These are required to be dropped and cannot be added. + type: list + run_as_user_type: + description: + - Type is the strategy that will dictate what RunAsUser is used in the SecurityContext. + aliases: + - type + run_as_user_uid: + description: + - UID is the user id that containers must run as. Required for the MustRunAs strategy + if not using namespace/service account allocated uids. + aliases: + - uid + type: int + run_as_user_uid_range_max: + description: + - UIDRangeMax defines the max value for a strategy that allocates by range. + aliases: + - uid_range_max + type: int + run_as_user_uid_range_min: + description: + - UIDRangeMin defines the min value for a strategy that allocates by range. + aliases: + - uid_range_min + type: int + se_linux_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - level + se_linux_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - role + se_linux_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - type + se_linux_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - user + se_linux_context_type: + description: + - Type is the strategy that will dictate what SELinux context is used in the SecurityContext. + aliases: + - type + seccomp_profiles: + description: + - SeccompProfiles lists the allowed profiles that may be set for the pod or container's + seccomp annotations. An unset (nil) or empty value means that no profiles may + be specifid by the pod or container. The wildcard '*' may be used to allow all + profiles. When used to generate a value for a pod the first non-wildcard profile + will be used as the default. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + supplemental_groups_ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would like to force + a single supplemental group then supply a single range with the same start and + end. + aliases: + - ranges + type: list + supplemental_groups_type: + description: + - Type is the strategy that will dictate what supplemental groups is used in the + SecurityContext. + aliases: + - type + username: + description: + - Provide a username for connecting to the API. + users: + description: + - The users who have permissions to use this security context constraints + type: list + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool + volumes: + description: + - Volumes is a white list of allowed volume plugins. FSType corresponds directly + with the field names of a VolumeSource (azureFile, configMap, emptyDir). To + allow all volumes you may use '*'. + type: list +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +security_context_constraints: + type: complex + returned: when I(state) = C(present) + contains: + allow_host_dir_volume_plugin: + description: + - AllowHostDirVolumePlugin determines if the policy allow containers to use + the HostDir volume plugin + type: bool + allow_host_ipc: + description: + - AllowHostIPC determines if the policy allows host ipc in the containers. + type: bool + allow_host_network: + description: + - AllowHostNetwork determines if the policy allows the use of HostNetwork in + the pod spec. + type: bool + allow_host_pid: + description: + - AllowHostPID determines if the policy allows host pid in the containers. + type: bool + allow_host_ports: + description: + - AllowHostPorts determines if the policy allows host ports in the containers. + type: bool + allow_privileged_container: + description: + - AllowPrivilegedContainer determines if a container can request to be run as + privileged. + type: bool + allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested to add + to the container. Capabilities in this field maybe added at the pod author's + discretion. You must not list a capability in both AllowedCapabilities and + RequiredDropCapabilities. + type: list + contains: str + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will be added + to the container unless the pod spec specifically drops the capability. You + may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities. + type: list + contains: str + fs_group: + description: + - FSGroup is the strategy that will dictate what fs group is used by the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like to force + a single fs group then supply a single range with the same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + type: + description: + - Type is the strategy that will dictate what FSGroup is used in the SecurityContext. + type: str + groups: + description: + - The groups that have permission to use this security context constraints + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + priority: + description: + - Priority influences the sort order of SCCs when evaluating which SCCs to try + first for a given pod request based on access in the Users and Groups fields. + The higher the int, the higher priority. If scores for multiple SCCs are equal + they will be sorted by name. + type: int + read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run with + a read only root file system. If the container specifically requests to run + with a non-read only root file system the SCC should deny the pod. If set + to false the container may run with a read only root file system if it wishes + but it will not be forced to. + type: bool + required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped from the + container. These are required to be dropped and cannot be added. + type: list + contains: str + run_as_user: + description: + - RunAsUser is the strategy that will dictate what RunAsUser is used in the + SecurityContext. + type: complex + contains: + type: + description: + - Type is the strategy that will dictate what RunAsUser is used in the SecurityContext. + type: str + uid: + description: + - UID is the user id that containers must run as. Required for the MustRunAs + strategy if not using namespace/service account allocated uids. + type: int + uid_range_max: + description: + - UIDRangeMax defines the max value for a strategy that allocates by range. + type: int + uid_range_min: + description: + - UIDRangeMin defines the min value for a strategy that allocates by range. + type: int + se_linux_context: + description: + - SELinuxContext is the strategy that will dictate what labels will be set in + the SecurityContext. + type: complex + contains: + se_linux_options: + description: + - seLinuxOptions required to run as; required for MustRunAs + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + type: + description: + - Type is the strategy that will dictate what SELinux context is used in + the SecurityContext. + type: str + seccomp_profiles: + description: + - SeccompProfiles lists the allowed profiles that may be set for the pod or + container's seccomp annotations. An unset (nil) or empty value means that + no profiles may be specifid by the pod or container. The wildcard '*' may + be used to allow all profiles. When used to generate a value for a pod the + first non-wildcard profile will be used as the default. + type: list + contains: str + supplemental_groups: + description: + - SupplementalGroups is the strategy that will dictate what supplemental groups + are used by the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would like + to force a single supplemental group then supply a single range with the + same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + type: + description: + - Type is the strategy that will dictate what supplemental groups is used + in the SecurityContext. + type: str + users: + description: + - The users who have permissions to use this security context constraints + type: list + contains: str + volumes: + description: + - Volumes is a white list of allowed volume plugins. FSType corresponds directly + with the field names of a VolumeSource (azureFile, configMap, emptyDir). To + allow all volumes you may use '*'. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('security_context_constraints', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_security_context_constraints_list.py b/library/k8s_v1_security_context_constraints_list.py new file mode 100644 index 00000000..0d9d3a8e --- /dev/null +++ b/library/k8s_v1_security_context_constraints_list.py @@ -0,0 +1,509 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_security_context_constraints_list +short_description: Kubernetes SecurityContextConstraintsList +description: +- Retrieve a list of security_context_constraints. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +security_context_constraints_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of security context constraints. + type: list + contains: + allow_host_dir_volume_plugin: + description: + - AllowHostDirVolumePlugin determines if the policy allow containers to + use the HostDir volume plugin + type: bool + allow_host_ipc: + description: + - AllowHostIPC determines if the policy allows host ipc in the containers. + type: bool + allow_host_network: + description: + - AllowHostNetwork determines if the policy allows the use of HostNetwork + in the pod spec. + type: bool + allow_host_pid: + description: + - AllowHostPID determines if the policy allows host pid in the containers. + type: bool + allow_host_ports: + description: + - AllowHostPorts determines if the policy allows host ports in the containers. + type: bool + allow_privileged_container: + description: + - AllowPrivilegedContainer determines if a container can request to be run + as privileged. + type: bool + allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested to + add to the container. Capabilities in this field maybe added at the pod + author's discretion. You must not list a capability in both AllowedCapabilities + and RequiredDropCapabilities. + type: list + contains: str + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will be + added to the container unless the pod spec specifically drops the capability. + You may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities. + type: list + contains: str + fs_group: + description: + - FSGroup is the strategy that will dictate what fs group is used by the + SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like to force + a single fs group then supply a single range with the same start and + end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + type: + description: + - Type is the strategy that will dictate what FSGroup is used in the + SecurityContext. + type: str + groups: + description: + - The groups that have permission to use this security context constraints + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + priority: + description: + - Priority influences the sort order of SCCs when evaluating which SCCs + to try first for a given pod request based on access in the Users and + Groups fields. The higher the int, the higher priority. If scores for + multiple SCCs are equal they will be sorted by name. + type: int + read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run with + a read only root file system. If the container specifically requests to + run with a non-read only root file system the SCC should deny the pod. + If set to false the container may run with a read only root file system + if it wishes but it will not be forced to. + type: bool + required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped from + the container. These are required to be dropped and cannot be added. + type: list + contains: str + run_as_user: + description: + - RunAsUser is the strategy that will dictate what RunAsUser is used in + the SecurityContext. + type: complex + contains: + type: + description: + - Type is the strategy that will dictate what RunAsUser is used in the + SecurityContext. + type: str + uid: + description: + - UID is the user id that containers must run as. Required for the MustRunAs + strategy if not using namespace/service account allocated uids. + type: int + uid_range_max: + description: + - UIDRangeMax defines the max value for a strategy that allocates by + range. + type: int + uid_range_min: + description: + - UIDRangeMin defines the min value for a strategy that allocates by + range. + type: int + se_linux_context: + description: + - SELinuxContext is the strategy that will dictate what labels will be set + in the SecurityContext. + type: complex + contains: + se_linux_options: + description: + - seLinuxOptions required to run as; required for MustRunAs + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + type: + description: + - Type is the strategy that will dictate what SELinux context is used + in the SecurityContext. + type: str + seccomp_profiles: + description: + - SeccompProfiles lists the allowed profiles that may be set for the pod + or container's seccomp annotations. An unset (nil) or empty value means + that no profiles may be specifid by the pod or container. The wildcard + '*' may be used to allow all profiles. When used to generate a value for + a pod the first non-wildcard profile will be used as the default. + type: list + contains: str + supplemental_groups: + description: + - SupplementalGroups is the strategy that will dictate what supplemental + groups are used by the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would + like to force a single supplemental group then supply a single range + with the same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + type: + description: + - Type is the strategy that will dictate what supplemental groups is + used in the SecurityContext. + type: str + users: + description: + - The users who have permissions to use this security context constraints + type: list + contains: str + volumes: + description: + - Volumes is a white list of allowed volume plugins. FSType corresponds + directly with the field names of a VolumeSource (azureFile, configMap, + emptyDir). To allow all volumes you may use '*'. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - '' + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('security_context_constraints_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_self_subject_rules_review.py b/library/k8s_v1_self_subject_rules_review.py new file mode 100644 index 00000000..d12203c3 --- /dev/null +++ b/library/k8s_v1_self_subject_rules_review.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_self_subject_rules_review +short_description: Kubernetes SelfSubjectRulesReview +description: +- Manage the lifecycle of a self_subject_rules_review object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_scopes: + description: + - Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions + of the user/groups". Nil means "use the scopes on this request". + aliases: + - scopes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +self_subject_rules_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + spec: + description: + - Spec adds information about how to conduct the check + type: complex + contains: + scopes: + description: + - Scopes to use for the evaluation. Empty means "use the unscoped (full) + permissions of the user/groups". Nil means "use the scopes on this request". + type: list + contains: str + status: + description: + - Status is completed by the server to tell which permissions you have + type: complex + contains: + evaluation_error: + description: + - EvaluationError can appear in combination with Rules. It means some error + happened during evaluation that may have prevented additional rules from + being populated. + type: str + rules: + description: + - Rules is the list of rules (no particular sort) that are allowed for the + subject + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against one + of the enumerated resources in either the kubernetes or the origin + API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the + path This name is intentionally different than the internal type so + that the DefaultConvert works nicely and because the ordering may + be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('self_subject_rules_review', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_service.py b/library/k8s_v1_service.py new file mode 100644 index 00000000..1346340c --- /dev/null +++ b/library/k8s_v1_service.py @@ -0,0 +1,607 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_service +short_description: Kubernetes Service +description: +- Manage the lifecycle of a service object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_cluster_ip: + description: + - clusterIP is the IP address of the service and is usually assigned randomly + by the master. If an address is specified manually and is not in use by others, + it will be allocated to the service; otherwise, creation of the service will + fail. This field can not be changed through updates. Valid values are "None", + empty string (""), or a valid IP address. "None" can be specified for headless + services when proxying is not required. Only applies to types ClusterIP, NodePort, + and LoadBalancer. Ignored if type is ExternalName. + aliases: + - cluster_ip + spec_deprecated_public_i_ps: + description: + - deprecatedPublicIPs is deprecated and replaced by the externalIPs field with + almost the exact same semantics. This field is retained in the v1 API for compatibility + until at least 8/20/2016. It will be removed from any new API revisions. If + both deprecatedPublicIPs *and* externalIPs are set, deprecatedPublicIPs is used. + aliases: + - deprecated_public_i_ps + type: list + spec_external_i_ps: + description: + - externalIPs is a list of IP addresses for which nodes in the cluster will also + accept traffic for this service. These IPs are not managed by Kubernetes. The + user is responsible for ensuring that traffic arrives at a node with this IP. + A common example is external load-balancers that are not part of the Kubernetes + system. A previous form of this functionality exists as the deprecatedPublicIPs + field. When using this field, callers should also clear the deprecatedPublicIPs + field. + aliases: + - external_i_ps + type: list + spec_external_name: + description: + - externalName is the external reference that kubedns or equivalent will return + as a CNAME record for this service. No proxying will be involved. Must be a + valid DNS name and requires Type to be ExternalName. + aliases: + - external_name + spec_load_balancer_ip: + description: + - 'Only applies to Service Type: LoadBalancer LoadBalancer will get created with + the IP specified in this field. This feature depends on whether the underlying + cloud-provider supports specifying the loadBalancerIP when a load balancer is + created. This field will be ignored if the cloud-provider does not support the + feature.' + aliases: + - load_balancer_ip + spec_load_balancer_source_ranges: + description: + - If specified and supported by the platform, this will restrict traffic through + the cloud-provider load-balancer will be restricted to the specified client + IPs. This field will be ignored if the cloud-provider does not support the feature." + aliases: + - load_balancer_source_ranges + type: list + spec_ports: + description: + - The list of ports that are exposed by this service. + aliases: + - ports + type: list + spec_selector: + description: + - Route service traffic to pods with label keys and values matching this selector. + If empty or not present, the service is assumed to have an external process + managing its endpoints, which Kubernetes will not modify. Only applies to types + ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. + aliases: + - selector + type: dict + spec_session_affinity: + description: + - Supports "ClientIP" and "None". Used to maintain session affinity. Enable client + IP based session affinity. Must be ClientIP or None. Defaults to None. + aliases: + - session_affinity + spec_type: + description: + - type determines how the Service is exposed. Defaults to ClusterIP. Valid options + are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ExternalName" maps + to the specified externalName. "ClusterIP" allocates a cluster-internal IP address + for load-balancing to endpoints. Endpoints are determined by the selector or + if that is not specified, by manual construction of an Endpoints object. If + clusterIP is "None", no virtual IP is allocated and the endpoints are published + as a set of endpoints rather than a stable IP. "NodePort" builds on ClusterIP + and allocates a port on every node which routes to the clusterIP. "LoadBalancer" + builds on NodePort and creates an external load-balancer (if supported in the + current cloud) which routes to the clusterIP. + aliases: + - type + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +- name: Create service + k8s_v1_service: + name: myservice + namespace: k8s-project + state: present + selector: + app: django + ports: + - port: 8765 + target_port: 8000 + name: http-port + type: ClusterIP + +- name: Patch service + k8s_v1_service: + name: myservice + namespace: k8s-project + state: present + selector: + app: django + env: production + ports: + - port: 8765 + target_port: 8010 + name: http-port + - port: 8788 + target_port: 8080 + name: socket-port + type: NodePort + +- name: Create service + k8s_v1_service: + name: myservice01 + namespace: k8s-project + state: present + selector: + app_name: service_testing + app_env: production + ports: + - port: 8888 + target_port: 8010 + name: http + type: ClusterIP + +- name: Patch service + k8s_v1_service: + name: myservice01 + namespace: k8s-project + state: present + ports: + - port: 9443 + target_port: 9443 + name: https + - port: 8888 + target_port: 8015 + name: http + +- name: Repace service + k8s_v1_service: + name: myservice01 + namespace: k8s-project + state: replaced + selector: + app_name: web_site + app_env: testing + ports: + - port: 9999 + target_port: 9999 + name: https + - port: 8080 + target_port: 8080 + name: http + type: ClusterIP +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +service: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the behavior of a service. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + cluster_ip: + description: + - clusterIP is the IP address of the service and is usually assigned randomly + by the master. If an address is specified manually and is not in use by + others, it will be allocated to the service; otherwise, creation of the + service will fail. This field can not be changed through updates. Valid + values are "None", empty string (""), or a valid IP address. "None" can + be specified for headless services when proxying is not required. Only + applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type + is ExternalName. + type: str + deprecated_public_i_ps: + description: + - deprecatedPublicIPs is deprecated and replaced by the externalIPs field + with almost the exact same semantics. This field is retained in the v1 + API for compatibility until at least 8/20/2016. It will be removed from + any new API revisions. If both deprecatedPublicIPs *and* externalIPs are + set, deprecatedPublicIPs is used. + type: list + contains: str + external_i_ps: + description: + - externalIPs is a list of IP addresses for which nodes in the cluster will + also accept traffic for this service. These IPs are not managed by Kubernetes. + The user is responsible for ensuring that traffic arrives at a node with + this IP. A common example is external load-balancers that are not part + of the Kubernetes system. A previous form of this functionality exists + as the deprecatedPublicIPs field. When using this field, callers should + also clear the deprecatedPublicIPs field. + type: list + contains: str + external_name: + description: + - externalName is the external reference that kubedns or equivalent will + return as a CNAME record for this service. No proxying will be involved. + Must be a valid DNS name and requires Type to be ExternalName. + type: str + load_balancer_ip: + description: + - 'Only applies to Service Type: LoadBalancer LoadBalancer will get created + with the IP specified in this field. This feature depends on whether the + underlying cloud-provider supports specifying the loadBalancerIP when + a load balancer is created. This field will be ignored if the cloud-provider + does not support the feature.' + type: str + load_balancer_source_ranges: + description: + - If specified and supported by the platform, this will restrict traffic + through the cloud-provider load-balancer will be restricted to the specified + client IPs. This field will be ignored if the cloud-provider does not + support the feature." + type: list + contains: str + ports: + description: + - The list of ports that are exposed by this service. + type: list + contains: + name: + description: + - The name of this port within the service. This must be a DNS_LABEL. + All ports within a ServiceSpec must have unique names. This maps to + the 'Name' field in EndpointPort objects. Optional if only one ServicePort + is defined on this service. + type: str + node_port: + description: + - The port on each node on which this service is exposed when type=NodePort + or LoadBalancer. Usually assigned by the system. If specified, it + will be allocated to the service if unused or else creation of the + service will fail. Default is to auto-allocate a port if the ServiceType + of this Service requires one. + type: int + port: + description: + - The port that will be exposed by this service. + type: int + protocol: + description: + - The IP protocol for this port. Supports "TCP" and "UDP". Default is + TCP. + type: str + target_port: + description: + - Number or name of the port to access on the pods targeted by the service. + Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + If this is a string, it will be looked up as a named port in the target + Pod's container ports. If this is not specified, the value of the + 'port' field is used (an identity map). This field is ignored for + services with clusterIP=None, and should be omitted or set equal to + the 'port' field. + type: complex + contains: {} + selector: + description: + - Route service traffic to pods with label keys and values matching this + selector. If empty or not present, the service is assumed to have an external + process managing its endpoints, which Kubernetes will not modify. Only + applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type + is ExternalName. + type: complex + contains: str, str + session_affinity: + description: + - Supports "ClientIP" and "None". Used to maintain session affinity. Enable + client IP based session affinity. Must be ClientIP or None. Defaults to + None. + type: str + type: + description: + - type determines how the Service is exposed. Defaults to ClusterIP. Valid + options are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ExternalName" + maps to the specified externalName. "ClusterIP" allocates a cluster-internal + IP address for load-balancing to endpoints. Endpoints are determined by + the selector or if that is not specified, by manual construction of an + Endpoints object. If clusterIP is "None", no virtual IP is allocated and + the endpoints are published as a set of endpoints rather than a stable + IP. "NodePort" builds on ClusterIP and allocates a port on every node + which routes to the clusterIP. "LoadBalancer" builds on NodePort and creates + an external load-balancer (if supported in the current cloud) which routes + to the clusterIP. + type: str + status: + description: + - Most recently observed status of the service. Populated by the system. Read-only. + type: complex + contains: + load_balancer: + description: + - LoadBalancer contains the current status of the load-balancer, if one + is present. + type: complex + contains: + ingress: + description: + - Ingress is a list containing ingress points for the load-balancer. + Traffic intended for the service should be sent to these ingress points. + type: list + contains: + hostname: + description: + - Hostname is set for load-balancer ingress points that are DNS + based (typically AWS load-balancers) + type: str + ip: + description: + - IP is set for load-balancer ingress points that are IP based (typically + GCE or OpenStack load-balancers) + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('service', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_service_account.py b/library/k8s_v1_service_account.py new file mode 100644 index 00000000..b0c2b3fd --- /dev/null +++ b/library/k8s_v1_service_account.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_service_account +short_description: Kubernetes ServiceAccount +description: +- Manage the lifecycle of a service_account object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + image_pull_secrets: + description: + - ImagePullSecrets is a list of references to secrets in the same namespace to + use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets + are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets + are only accessed by the kubelet. + type: list + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + secrets: + description: + - Secrets is the list of secrets allowed to be used by pods running using this + ServiceAccount. + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +service_account: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is a list of references to secrets in the same namespace + to use for pulling any images in pods that reference this ServiceAccount. + ImagePullSecrets are distinct from Secrets because Secrets can be mounted + in the pod, but ImagePullSecrets are only accessed by the kubelet. + type: list + contains: + name: + description: + - Name of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + secrets: + description: + - Secrets is the list of secrets allowed to be used by pods running using this + ServiceAccount. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('service_account', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_service_account_list.py b/library/k8s_v1_service_account_list.py new file mode 100644 index 00000000..36c3e4e6 --- /dev/null +++ b/library/k8s_v1_service_account_list.py @@ -0,0 +1,364 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_service_account_list +short_description: Kubernetes ServiceAccountList +description: +- Retrieve a list of service_accounts. List operations provide a snapshot read of + the underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +service_account_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of ServiceAccounts. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is a list of references to secrets in the same namespace + to use for pulling any images in pods that reference this ServiceAccount. + ImagePullSecrets are distinct from Secrets because Secrets can be mounted + in the pod, but ImagePullSecrets are only accessed by the kubelet. + type: list + contains: + name: + description: + - Name of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + secrets: + description: + - Secrets is the list of secrets allowed to be used by pods running using + this ServiceAccount. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('service_account_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_service_list.py b/library/k8s_v1_service_list.py new file mode 100644 index 00000000..cf0e7a12 --- /dev/null +++ b/library/k8s_v1_service_list.py @@ -0,0 +1,466 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_service_list +short_description: Kubernetes ServiceList +description: +- Retrieve a list of services. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +service_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of services + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the behavior of a service. http://releases.k8s.io/HEAD/docs/devel/api-conventions.md + type: complex + contains: + cluster_ip: + description: + - clusterIP is the IP address of the service and is usually assigned + randomly by the master. If an address is specified manually and is + not in use by others, it will be allocated to the service; otherwise, + creation of the service will fail. This field can not be changed through + updates. Valid values are "None", empty string (""), or a valid IP + address. "None" can be specified for headless services when proxying + is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. + Ignored if type is ExternalName. + type: str + deprecated_public_i_ps: + description: + - deprecatedPublicIPs is deprecated and replaced by the externalIPs + field with almost the exact same semantics. This field is retained + in the v1 API for compatibility until at least 8/20/2016. It will + be removed from any new API revisions. If both deprecatedPublicIPs + *and* externalIPs are set, deprecatedPublicIPs is used. + type: list + contains: str + external_i_ps: + description: + - externalIPs is a list of IP addresses for which nodes in the cluster + will also accept traffic for this service. These IPs are not managed + by Kubernetes. The user is responsible for ensuring that traffic arrives + at a node with this IP. A common example is external load-balancers + that are not part of the Kubernetes system. A previous form of this + functionality exists as the deprecatedPublicIPs field. When using + this field, callers should also clear the deprecatedPublicIPs field. + type: list + contains: str + external_name: + description: + - externalName is the external reference that kubedns or equivalent + will return as a CNAME record for this service. No proxying will be + involved. Must be a valid DNS name and requires Type to be ExternalName. + type: str + load_balancer_ip: + description: + - 'Only applies to Service Type: LoadBalancer LoadBalancer will get + created with the IP specified in this field. This feature depends + on whether the underlying cloud-provider supports specifying the loadBalancerIP + when a load balancer is created. This field will be ignored if the + cloud-provider does not support the feature.' + type: str + load_balancer_source_ranges: + description: + - If specified and supported by the platform, this will restrict traffic + through the cloud-provider load-balancer will be restricted to the + specified client IPs. This field will be ignored if the cloud-provider + does not support the feature." + type: list + contains: str + ports: + description: + - The list of ports that are exposed by this service. + type: list + contains: + name: + description: + - The name of this port within the service. This must be a DNS_LABEL. + All ports within a ServiceSpec must have unique names. This maps + to the 'Name' field in EndpointPort objects. Optional if only + one ServicePort is defined on this service. + type: str + node_port: + description: + - The port on each node on which this service is exposed when type=NodePort + or LoadBalancer. Usually assigned by the system. If specified, + it will be allocated to the service if unused or else creation + of the service will fail. Default is to auto-allocate a port if + the ServiceType of this Service requires one. + type: int + port: + description: + - The port that will be exposed by this service. + type: int + protocol: + description: + - The IP protocol for this port. Supports "TCP" and "UDP". Default + is TCP. + type: str + target_port: + description: + - Number or name of the port to access on the pods targeted by the + service. Number must be in the range 1 to 65535. Name must be + an IANA_SVC_NAME. If this is a string, it will be looked up as + a named port in the target Pod's container ports. If this is not + specified, the value of the 'port' field is used (an identity + map). This field is ignored for services with clusterIP=None, + and should be omitted or set equal to the 'port' field. + type: complex + contains: {} + selector: + description: + - Route service traffic to pods with label keys and values matching + this selector. If empty or not present, the service is assumed to + have an external process managing its endpoints, which Kubernetes + will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. + Ignored if type is ExternalName. + type: complex + contains: str, str + session_affinity: + description: + - Supports "ClientIP" and "None". Used to maintain session affinity. + Enable client IP based session affinity. Must be ClientIP or None. + Defaults to None. + type: str + type: + description: + - type determines how the Service is exposed. Defaults to ClusterIP. + Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. + "ExternalName" maps to the specified externalName. "ClusterIP" allocates + a cluster-internal IP address for load-balancing to endpoints. Endpoints + are determined by the selector or if that is not specified, by manual + construction of an Endpoints object. If clusterIP is "None", no virtual + IP is allocated and the endpoints are published as a set of endpoints + rather than a stable IP. "NodePort" builds on ClusterIP and allocates + a port on every node which routes to the clusterIP. "LoadBalancer" + builds on NodePort and creates an external load-balancer (if supported + in the current cloud) which routes to the clusterIP. + type: str + status: + description: + - Most recently observed status of the service. Populated by the system. + Read-only. + type: complex + contains: + load_balancer: + description: + - LoadBalancer contains the current status of the load-balancer, if + one is present. + type: complex + contains: + ingress: + description: + - Ingress is a list containing ingress points for the load-balancer. + Traffic intended for the service should be sent to these ingress + points. + type: list + contains: + hostname: + description: + - Hostname is set for load-balancer ingress points that are + DNS based (typically AWS load-balancers) + type: str + ip: + description: + - IP is set for load-balancer ingress points that are IP based + (typically GCE or OpenStack load-balancers) + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('service_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_subject_rules_review.py b/library/k8s_v1_subject_rules_review.py new file mode 100644 index 00000000..6f18c4ea --- /dev/null +++ b/library/k8s_v1_subject_rules_review.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_subject_rules_review +short_description: Kubernetes SubjectRulesReview +description: +- Manage the lifecycle of a subject_rules_review object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_groups: + description: + - Groups is optional. Groups is the list of groups to which the User belongs. + At least one of User and Groups must be specified. + aliases: + - groups + type: list + spec_scopes: + description: + - Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions + of the user/groups". + aliases: + - scopes + type: list + spec_user: + description: + - User is optional. At least one of User and Groups must be specified. + aliases: + - user + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +subject_rules_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + spec: + description: + - Spec adds information about how to conduct the check + type: complex + contains: + groups: + description: + - Groups is optional. Groups is the list of groups to which the User belongs. + At least one of User and Groups must be specified. + type: list + contains: str + scopes: + description: + - Scopes to use for the evaluation. Empty means "use the unscoped (full) + permissions of the user/groups". + type: list + contains: str + user: + description: + - User is optional. At least one of User and Groups must be specified. + type: str + status: + description: + - Status is completed by the server to tell which permissions you have + type: complex + contains: + evaluation_error: + description: + - EvaluationError can appear in combination with Rules. It means some error + happened during evaluation that may have prevented additional rules from + being populated. + type: str + rules: + description: + - Rules is the list of rules (no particular sort) that are allowed for the + subject + type: list + contains: + api_groups: + description: + - APIGroups is the name of the APIGroup that contains the resources. + If this field is empty, then both kubernetes and origin API groups + are assumed. That means that if an action is requested against one + of the enumerated resources in either the kubernetes or the origin + API group, the request will be allowed + type: list + contains: str + attribute_restrictions: + description: + - AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder + pair supports. If the Authorizer does not recognize how to handle + the AttributeRestrictions, the Authorizer should report an error. + type: complex + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + non_resource_ur_ls: + description: + - NonResourceURLsSlice is a set of partial urls that a user should have + access to. *s are allowed, but only as the full, final step in the + path This name is intentionally different than the internal type so + that the DefaultConvert works nicely and because the ordering may + be different. + type: list + contains: str + resource_names: + description: + - ResourceNames is an optional white list of names that the rule applies + to. An empty set means that everything is allowed. + type: list + contains: str + resources: + description: + - Resources is a list of resources this rule applies to. ResourceAll + represents all resources. + type: list + contains: str + verbs: + description: + - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions + contained in this rule. VerbAll represents all kinds. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('subject_rules_review', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_template.py b/library/k8s_v1_template.py new file mode 100644 index 00000000..7e6a79e2 --- /dev/null +++ b/library/k8s_v1_template.py @@ -0,0 +1,381 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_template +short_description: Kubernetes Template +description: +- Manage the lifecycle of a template object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + message: + description: + - message is an optional instructional message that will be displayed when this + template is instantiated. This field should inform the user how to utilize the + newly created resources. Parameter substitution will be performed on the message + before being displayed so that generated credentials and other parameters can + be included in the output. + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + objects: + description: + - objects is an array of resources to include in this template. If a namespace + value is hardcoded in the object, it will be removed during template instantiation, + however if the namespace value is, or contains, a ${PARAMETER_REFERENCE}, the + resolved value after parameter substitution will be respected and the object + will be created in that namespace. + type: list + parameters: + description: + - parameters is an optional array of Parameters used during the Template to Config + transformation. + type: list + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +template: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + labels: + description: + - labels is a optional set of labels that are applied to every object during + the Template to Config transformation. + type: complex + contains: str, str + message: + description: + - message is an optional instructional message that will be displayed when this + template is instantiated. This field should inform the user how to utilize + the newly created resources. Parameter substitution will be performed on the + message before being displayed so that generated credentials and other parameters + can be included in the output. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + objects: + description: + - objects is an array of resources to include in this template. If a namespace + value is hardcoded in the object, it will be removed during template instantiation, + however if the namespace value is, or contains, a ${PARAMETER_REFERENCE}, + the resolved value after parameter substitution will be respected and the + object will be created in that namespace. + type: list + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + parameters: + description: + - parameters is an optional array of Parameters used during the Template to + Config transformation. + type: list + contains: + _from: + description: + - From is an input value for the generator. Optional. + type: str + description: + description: + - Description of a parameter. Optional. + type: str + display_name: + description: + - "Optional: The name that will show in UI instead of parameter 'Name'" + type: str + generate: + description: + - 'generate specifies the generator to be used to generate random string + from an input value specified by From field. The result string is stored + into Value field. If empty, no generator is being used, leaving the result + Value untouched. Optional. The only supported generator is "expression", + which accepts a "from" value in the form of a simple regular expression + containing the range expression "[a-zA-Z0-9]", and the length expression + "a{length}". Examples: from | value ----------------------------- "test[0-9]{1}x" + | "test7x" "[0-1]{8}" | "01001100" "0x[A-F0-9]{4}" | "0xB3AF" "[a-zA-Z0-9]{8}" + | "hW4yQU5i"' + type: str + name: + description: + - Name must be set and it can be referenced in Template Items using ${PARAMETER_NAME}. + Required. + type: str + required: + description: + - 'Optional: Indicates the parameter must have a value. Defaults to false.' + type: bool + value: + description: + - Value holds the Parameter data. If specified, the generator will be ignored. + The value replaces all occurrences of the Parameter ${Name} expression + during the Template to Config transformation. Optional. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('template', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_template_list.py b/library/k8s_v1_template_list.py new file mode 100644 index 00000000..15e04393 --- /dev/null +++ b/library/k8s_v1_template_list.py @@ -0,0 +1,383 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_template_list +short_description: Kubernetes TemplateList +description: +- Retrieve a list of templates. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +template_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of templates + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + labels: + description: + - labels is a optional set of labels that are applied to every object during + the Template to Config transformation. + type: complex + contains: str, str + message: + description: + - message is an optional instructional message that will be displayed when + this template is instantiated. This field should inform the user how to + utilize the newly created resources. Parameter substitution will be performed + on the message before being displayed so that generated credentials and + other parameters can be included in the output. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + objects: + description: + - objects is an array of resources to include in this template. If a namespace + value is hardcoded in the object, it will be removed during template instantiation, + however if the namespace value is, or contains, a ${PARAMETER_REFERENCE}, + the resolved value after parameter substitution will be respected and + the object will be created in that namespace. + type: list + contains: + raw: + description: + - Raw is the underlying serialization of this object. + type: str + parameters: + description: + - parameters is an optional array of Parameters used during the Template + to Config transformation. + type: list + contains: + _from: + description: + - From is an input value for the generator. Optional. + type: str + description: + description: + - Description of a parameter. Optional. + type: str + display_name: + description: + - "Optional: The name that will show in UI instead of parameter 'Name'" + type: str + generate: + description: + - 'generate specifies the generator to be used to generate random string + from an input value specified by From field. The result string is + stored into Value field. If empty, no generator is being used, leaving + the result Value untouched. Optional. The only supported generator + is "expression", which accepts a "from" value in the form of a simple + regular expression containing the range expression "[a-zA-Z0-9]", + and the length expression "a{length}". Examples: from | value ----------------------------- + "test[0-9]{1}x" | "test7x" "[0-1]{8}" | "01001100" "0x[A-F0-9]{4}" + | "0xB3AF" "[a-zA-Z0-9]{8}" | "hW4yQU5i"' + type: str + name: + description: + - Name must be set and it can be referenced in Template Items using + ${PARAMETER_NAME}. Required. + type: str + required: + description: + - 'Optional: Indicates the parameter must have a value. Defaults to + false.' + type: bool + value: + description: + - Value holds the Parameter data. If specified, the generator will be + ignored. The value replaces all occurrences of the Parameter ${Name} + expression during the Template to Config transformation. Optional. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('template_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_user.py b/library/k8s_v1_user.py new file mode 100644 index 00000000..0ab251ca --- /dev/null +++ b/library/k8s_v1_user.py @@ -0,0 +1,318 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_user +short_description: Kubernetes User +description: +- Manage the lifecycle of a user object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + full_name: + description: + - FullName is the full name of user + groups: + description: + - Groups specifies group names this user is a member of. This field is deprecated + and will be removed in a future release. Instead, create a Group object containing + the name of this User. + type: list + host: + description: + - Provide a URL for acessing the Kubernetes API. + identities: + description: + - Identities are the identities associated with this user + type: list + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +user: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + full_name: + description: + - FullName is the full name of user + type: str + groups: + description: + - Groups specifies group names this user is a member of. This field is deprecated + and will be removed in a future release. Instead, create a Group object containing + the name of this User. + type: list + contains: str + identities: + description: + - Identities are the identities associated with this user + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('user', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_user_identity_mapping.py b/library/k8s_v1_user_identity_mapping.py new file mode 100644 index 00000000..86af135e --- /dev/null +++ b/library/k8s_v1_user_identity_mapping.py @@ -0,0 +1,451 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_user_identity_mapping +short_description: Kubernetes UserIdentityMapping +description: +- Manage the lifecycle of a user_identity_mapping object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + identity_api_version: + description: + - API version of the referent. + aliases: + - api_version + identity_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + identity_kind: + description: + - Kind of the referent. + aliases: + - kind + identity_name: + description: + - Name of the referent. + aliases: + - name + identity_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + identity_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + identity_uid: + description: + - UID of the referent. + aliases: + - uid + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + user_api_version: + description: + - API version of the referent. + aliases: + - api_version + user_field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would + take on a value like: "spec.containers{name}" (where "name" refers to the name + of the container that triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of an object.' + aliases: + - field_path + user_kind: + description: + - Kind of the referent. + aliases: + - kind + user_name: + description: + - Name of the referent. + aliases: + - name + user_namespace: + description: + - Namespace of the referent. + aliases: + - namespace + user_resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + aliases: + - resource_version + user_uid: + description: + - UID of the referent. + aliases: + - uid + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +user_identity_mapping: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + identity: + description: + - Identity is a reference to an identity + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + user: + description: + - User is a reference to a user + type: complex + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, this + string should contain a valid JSON/Go field access statement, such as + desiredState.manifest.containers[2]. For example, if the object reference + is to a container within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered the event) + or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('user_identity_mapping', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1_user_list.py b/library/k8s_v1_user_list.py new file mode 100644 index 00000000..c0c074d8 --- /dev/null +++ b/library/k8s_v1_user_list.py @@ -0,0 +1,326 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1_user_list +short_description: Kubernetes UserList +description: +- Retrieve a list of users. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +user_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of users + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + full_name: + description: + - FullName is the full name of user + type: str + groups: + description: + - Groups specifies group names this user is a member of. This field is deprecated + and will be removed in a future release. Instead, create a Group object + containing the name of this User. + type: list + contains: str + identities: + description: + - Identities are the identities associated with this user + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('user_list', 'V1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1alpha1_certificate_signing_request.py b/library/k8s_v1alpha1_certificate_signing_request.py new file mode 100644 index 00000000..348e28bf --- /dev/null +++ b/library/k8s_v1alpha1_certificate_signing_request.py @@ -0,0 +1,359 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1alpha1_certificate_signing_request +short_description: Kubernetes CertificateSigningRequest +description: +- Manage the lifecycle of a certificate_signing_request object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_groups: + aliases: + - groups + type: list + spec_request: + description: + - Base64-encoded PKCS + aliases: + - request + spec_uid: + aliases: + - uid + spec_username: + description: + - Information about the requesting user (if relevant) See user.Info interface + for details + aliases: + - username + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +certificate_signing_request: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - The certificate request itself and any additional information. + type: complex + contains: + groups: + description: [] + type: list + contains: str + request: + description: + - Base64-encoded PKCS + type: str + uid: + description: [] + type: str + username: + description: + - Information about the requesting user (if relevant) See user.Info interface + for details + type: str + status: + description: + - Derived information about the request. + type: complex + contains: + certificate: + description: + - If request was approved, the controller will place the issued certificate + here. + type: str + conditions: + description: + - Conditions applied to the request, such as approval or denial. + type: list + contains: + last_update_time: + description: + - timestamp for the last update to this condition + type: complex + contains: {} + message: + description: + - human readable message with details about the request state + type: str + reason: + description: + - brief reason for the request state + type: str + type: + description: + - request approval state, currently Approved or Denied. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('certificate_signing_request', 'V1alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1alpha1_certificate_signing_request_list.py b/library/k8s_v1alpha1_certificate_signing_request_list.py new file mode 100644 index 00000000..6cdcbd64 --- /dev/null +++ b/library/k8s_v1alpha1_certificate_signing_request_list.py @@ -0,0 +1,360 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1alpha1_certificate_signing_request_list +short_description: Kubernetes CertificateSigningRequestList +description: +- Retrieve a list of certificate_signing_requests. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +certificate_signing_request_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: [] + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - The certificate request itself and any additional information. + type: complex + contains: + groups: + description: [] + type: list + contains: str + request: + description: + - Base64-encoded PKCS + type: str + uid: + description: [] + type: str + username: + description: + - Information about the requesting user (if relevant) See user.Info + interface for details + type: str + status: + description: + - Derived information about the request. + type: complex + contains: + certificate: + description: + - If request was approved, the controller will place the issued certificate + here. + type: str + conditions: + description: + - Conditions applied to the request, such as approval or denial. + type: list + contains: + last_update_time: + description: + - timestamp for the last update to this condition + type: complex + contains: {} + message: + description: + - human readable message with details about the request state + type: str + reason: + description: + - brief reason for the request state + type: str + type: + description: + - request approval state, currently Approved or Denied. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('certificate_signing_request_list', 'V1alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_daemon_set.py b/library/k8s_v1beta1_daemon_set.py new file mode 100644 index 00000000..562311fc --- /dev/null +++ b/library/k8s_v1beta1_daemon_set.py @@ -0,0 +1,2382 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_daemon_set +short_description: Kubernetes DaemonSet +description: +- Manage the lifecycle of a daemon_set object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +daemon_set: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired behavior of this daemon set. + type: complex + contains: + selector: + description: + - Selector is a label query over pods that are managed by the daemon set. + Must match in order to be controlled. If empty, defaulted to labels on + Pod template. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created. The + DaemonSet will create exactly one copy of this pod on every node that + matches the template's node selector (or on every node if no node selector + is specified). + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the current status of this daemon set. This data may be out of date + by some window of time. Populated by the system. Read-only. + type: complex + contains: + current_number_scheduled: + description: + - CurrentNumberScheduled is the number of nodes that are running at least + 1 daemon pod and are supposed to run the daemon pod. + type: int + desired_number_scheduled: + description: + - DesiredNumberScheduled is the total number of nodes that should be running + the daemon pod (including nodes correctly running the daemon pod). + type: int + number_misscheduled: + description: + - NumberMisscheduled is the number of nodes that are running the daemon + pod, but are not supposed to run the daemon pod. + type: int + number_ready: + description: + - NumberReady is the number of nodes that should be running the daemon pod + and have one or more of the daemon pod running and ready. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('daemon_set', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_daemon_set_list.py b/library/k8s_v1beta1_daemon_set_list.py new file mode 100644 index 00000000..d9a756d1 --- /dev/null +++ b/library/k8s_v1beta1_daemon_set_list.py @@ -0,0 +1,2239 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_daemon_set_list +short_description: Kubernetes DaemonSetList +description: +- Retrieve a list of daemon_sets. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +daemon_set_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of daemon sets. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired behavior of this daemon set. + type: complex + contains: + selector: + description: + - Selector is a label query over pods that are managed by the daemon + set. Must match in order to be controlled. If empty, defaulted to + labels on Pod template. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created. + The DaemonSet will create exactly one copy of this pod on every node + that matches the template's node selector (or on every node if no + node selector is specified). + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the current status of this daemon set. This data may be out + of date by some window of time. Populated by the system. Read-only. + type: complex + contains: + current_number_scheduled: + description: + - CurrentNumberScheduled is the number of nodes that are running at + least 1 daemon pod and are supposed to run the daemon pod. + type: int + desired_number_scheduled: + description: + - DesiredNumberScheduled is the total number of nodes that should be + running the daemon pod (including nodes correctly running the daemon + pod). + type: int + number_misscheduled: + description: + - NumberMisscheduled is the number of nodes that are running the daemon + pod, but are not supposed to run the daemon pod. + type: int + number_ready: + description: + - NumberReady is the number of nodes that should be running the daemon + pod and have one or more of the daemon pod running and ready. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('daemon_set_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_deployment.py b/library/k8s_v1beta1_deployment.py new file mode 100644 index 00000000..d8a49e3d --- /dev/null +++ b/library/k8s_v1beta1_deployment.py @@ -0,0 +1,2549 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_deployment +short_description: Kubernetes Deployment +description: +- Manage the lifecycle of a deployment object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready without + any of its container crashing, for it to be considered available. Defaults to + 0 (pod will be considered available as soon as it is ready) + aliases: + - min_ready_seconds + type: int + spec_paused: + description: + - Indicates that the deployment is paused and will not be processed by the deployment + controller. + aliases: + - paused + type: bool + spec_progress_deadline_seconds: + description: + - The maximum time in seconds for a deployment to make progress before it is considered + to be failed. The deployment controller will continue to process failed deployments + and a condition with a ProgressDeadlineExceeded reason will be surfaced in the + deployment status. Once autoRollback is implemented, the deployment controller + will automatically rollback failed deployments. Note that progress will not + be estimated during the time a deployment is paused. This is not set by default. + aliases: + - progress_deadline_seconds + type: int + spec_replicas: + description: + - Number of desired pods. This is a pointer to distinguish between explicit zero + and not specified. Defaults to 1. + aliases: + - replicas + type: int + spec_revision_history_limit: + description: + - The number of old ReplicaSets to retain to allow rollback. This is a pointer + to distinguish between explicit zero and not specified. + aliases: + - revision_history_limit + type: int + spec_rollback_to_revision: + description: + - The revision to rollback to. If set to 0, rollbck to the last revision. + aliases: + - rollback_to_revision + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_strategy_type: + description: + - Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. + aliases: + - strategy_type + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +deployment: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the Deployment. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready + without any of its container crashing, for it to be considered available. + Defaults to 0 (pod will be considered available as soon as it is ready) + type: int + paused: + description: + - Indicates that the deployment is paused and will not be processed by the + deployment controller. + type: bool + progress_deadline_seconds: + description: + - The maximum time in seconds for a deployment to make progress before it + is considered to be failed. The deployment controller will continue to + process failed deployments and a condition with a ProgressDeadlineExceeded + reason will be surfaced in the deployment status. Once autoRollback is + implemented, the deployment controller will automatically rollback failed + deployments. Note that progress will not be estimated during the time + a deployment is paused. This is not set by default. + type: int + replicas: + description: + - Number of desired pods. This is a pointer to distinguish between explicit + zero and not specified. Defaults to 1. + type: int + revision_history_limit: + description: + - The number of old ReplicaSets to retain to allow rollback. This is a pointer + to distinguish between explicit zero and not specified. + type: int + rollback_to: + description: + - The config this deployment is rolling back to. Will be cleared after rollback + is done. + type: complex + contains: + revision: + description: + - The revision to rollback to. If set to 0, rollbck to the last revision. + type: int + selector: + description: + - Label selector for pods. Existing ReplicaSets whose pods are selected + by this will be the ones affected by this deployment. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + strategy: + description: + - The deployment strategy to use to replace existing pods with new ones. + type: complex + contains: + rolling_update: + description: + - Rolling update config params. Present only if DeploymentStrategyType + = RollingUpdate. + type: complex + contains: + max_surge: + description: + - 'The maximum number of pods that can be scheduled above the desired + number of pods. Value can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if MaxUnavailable + is 0. Absolute number is calculated from percentage by rounding + up. By default, a value of 1 is used. Example: when this is set + to 30%, the new RC can be scaled up immediately when the rolling + update starts, such that the total number of old and new pods + do not exceed 130% of desired pods. Once old pods have been killed, + new RC can be scaled up further, ensuring that total number of + pods running at any time during the update is atmost 130% of desired + pods.' + type: complex + contains: {} + max_unavailable: + description: + - 'The maximum number of pods that can be unavailable during the + update. Value can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). Absolute number is calculated from + percentage by rounding up. This can not be 0 if MaxSurge is 0. + By default, a fixed value of 1 is used. Example: when this is + set to 30%, the old RC can be scaled down to 70% of desired pods + immediately when the rolling update starts. Once new pods are + ready, old RC can be scaled down further, followed by scaling + up the new RC, ensuring that the total number of pods available + at all times during the update is at least 70% of desired pods.' + type: complex + contains: {} + type: + description: + - Type of deployment. Can be "Recreate" or "RollingUpdate". Default + is RollingUpdate. + type: str + template: + description: + - Template describes the pods that will be created. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Most recently observed status of the Deployment. + type: complex + contains: + available_replicas: + description: + - Total number of available pods (ready for at least minReadySeconds) targeted + by this deployment. + type: int + conditions: + description: + - Represents the latest available observations of a deployment's current + state. + type: list + contains: + last_transition_time: + description: + - Last time the condition transitioned from one status to another. + type: complex + contains: {} + last_update_time: + description: + - The last time this condition was updated. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of deployment condition. + type: str + observed_generation: + description: + - The generation observed by the deployment controller. + type: int + replicas: + description: + - Total number of non-terminated pods targeted by this deployment (their + labels match the selector). + type: int + unavailable_replicas: + description: + - Total number of unavailable pods targeted by this deployment. + type: int + updated_replicas: + description: + - Total number of non-terminated pods targeted by this deployment that have + the desired template spec. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('deployment', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_deployment_list.py b/library/k8s_v1beta1_deployment_list.py new file mode 100644 index 00000000..2781eab0 --- /dev/null +++ b/library/k8s_v1beta1_deployment_list.py @@ -0,0 +1,2357 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_deployment_list +short_description: Kubernetes DeploymentList +description: +- Retrieve a list of deployments. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +deployment_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Deployments. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the Deployment. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be + ready without any of its container crashing, for it to be considered + available. Defaults to 0 (pod will be considered available as soon + as it is ready) + type: int + paused: + description: + - Indicates that the deployment is paused and will not be processed + by the deployment controller. + type: bool + progress_deadline_seconds: + description: + - The maximum time in seconds for a deployment to make progress before + it is considered to be failed. The deployment controller will continue + to process failed deployments and a condition with a ProgressDeadlineExceeded + reason will be surfaced in the deployment status. Once autoRollback + is implemented, the deployment controller will automatically rollback + failed deployments. Note that progress will not be estimated during + the time a deployment is paused. This is not set by default. + type: int + replicas: + description: + - Number of desired pods. This is a pointer to distinguish between explicit + zero and not specified. Defaults to 1. + type: int + revision_history_limit: + description: + - The number of old ReplicaSets to retain to allow rollback. This is + a pointer to distinguish between explicit zero and not specified. + type: int + rollback_to: + description: + - The config this deployment is rolling back to. Will be cleared after + rollback is done. + type: complex + contains: + revision: + description: + - The revision to rollback to. If set to 0, rollbck to the last + revision. + type: int + selector: + description: + - Label selector for pods. Existing ReplicaSets whose pods are selected + by this will be the ones affected by this deployment. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + strategy: + description: + - The deployment strategy to use to replace existing pods with new ones. + type: complex + contains: + rolling_update: + description: + - Rolling update config params. Present only if DeploymentStrategyType + = RollingUpdate. + type: complex + contains: + max_surge: + description: + - 'The maximum number of pods that can be scheduled above the + desired number of pods. Value can be an absolute number (ex: + 5) or a percentage of desired pods (ex: 10%). This can not + be 0 if MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. By default, a value of 1 is + used. Example: when this is set to 30%, the new RC can be + scaled up immediately when the rolling update starts, such + that the total number of old and new pods do not exceed 130% + of desired pods. Once old pods have been killed, new RC can + be scaled up further, ensuring that total number of pods running + at any time during the update is atmost 130% of desired pods.' + type: complex + contains: {} + max_unavailable: + description: + - 'The maximum number of pods that can be unavailable during + the update. Value can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). Absolute number is calculated from + percentage by rounding up. This can not be 0 if MaxSurge is + 0. By default, a fixed value of 1 is used. Example: when this + is set to 30%, the old RC can be scaled down to 70% of desired + pods immediately when the rolling update starts. Once new + pods are ready, old RC can be scaled down further, followed + by scaling up the new RC, ensuring that the total number of + pods available at all times during the update is at least + 70% of desired pods.' + type: complex + contains: {} + type: + description: + - Type of deployment. Can be "Recreate" or "RollingUpdate". Default + is RollingUpdate. + type: str + template: + description: + - Template describes the pods that will be created. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Most recently observed status of the Deployment. + type: complex + contains: + available_replicas: + description: + - Total number of available pods (ready for at least minReadySeconds) + targeted by this deployment. + type: int + conditions: + description: + - Represents the latest available observations of a deployment's current + state. + type: list + contains: + last_transition_time: + description: + - Last time the condition transitioned from one status to another. + type: complex + contains: {} + last_update_time: + description: + - The last time this condition was updated. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of deployment condition. + type: str + observed_generation: + description: + - The generation observed by the deployment controller. + type: int + replicas: + description: + - Total number of non-terminated pods targeted by this deployment (their + labels match the selector). + type: int + unavailable_replicas: + description: + - Total number of unavailable pods targeted by this deployment. + type: int + updated_replicas: + description: + - Total number of non-terminated pods targeted by this deployment that + have the desired template spec. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('deployment_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_eviction.py b/library/k8s_v1beta1_eviction.py new file mode 100644 index 00000000..7019ea2e --- /dev/null +++ b/library/k8s_v1beta1_eviction.py @@ -0,0 +1,352 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_eviction +short_description: Kubernetes Eviction +description: +- Manage the lifecycle of a eviction object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + delete_options_api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + aliases: + - api_version + delete_options_grace_period_seconds: + description: + - The duration in seconds before the object should be deleted. Value must be non-negative + integer. The value zero indicates delete immediately. If this value is nil, + the default grace period for the specified type will be used. Defaults to a + per object value if not specified. zero means delete immediately. + aliases: + - grace_period_seconds + type: int + delete_options_kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + aliases: + - kind + delete_options_orphan_dependents: + description: + - Should the dependent objects be orphaned. If true/false, the "orphan" finalizer + will be added to/removed from the object's finalizers list. + aliases: + - orphan_dependents + type: bool + delete_options_preconditions_uid: + description: + - Specifies the target UID. + aliases: + - uid + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +eviction: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + delete_options: + description: + - DeleteOptions may be provided + type: complex + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + grace_period_seconds: + description: + - The duration in seconds before the object should be deleted. Value must + be non-negative integer. The value zero indicates delete immediately. + If this value is nil, the default grace period for the specified type + will be used. Defaults to a per object value if not specified. zero means + delete immediately. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + orphan_dependents: + description: + - Should the dependent objects be orphaned. If true/false, the "orphan" + finalizer will be added to/removed from the object's finalizers list. + type: bool + preconditions: + description: + - Must be fulfilled before a deletion is carried out. If not possible, a + 409 Conflict status will be returned. + type: complex + contains: + uid: + description: + - Specifies the target UID. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - ObjectMeta describes the pod that is being evicted. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('eviction', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_horizontal_pod_autoscaler.py b/library/k8s_v1beta1_horizontal_pod_autoscaler.py new file mode 100644 index 00000000..e4bb62d9 --- /dev/null +++ b/library/k8s_v1beta1_horizontal_pod_autoscaler.py @@ -0,0 +1,409 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_horizontal_pod_autoscaler +short_description: Kubernetes HorizontalPodAutoscaler +description: +- Manage the lifecycle of a horizontal_pod_autoscaler object. Supports check mode, + and attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_cpu_utilization_target_percentage: + description: + - fraction of the requested CPU that should be utilized/used, e.g. 70 means that + 70% of the requested CPU should be in use. + aliases: + - cpu_utilization_target_percentage + type: int + spec_max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; cannot + be smaller than MinReplicas. + aliases: + - max_replicas + type: int + spec_min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, default + 1. + aliases: + - min_replicas + type: int + spec_scale_ref_api_version: + description: + - API version of the referent + aliases: + - scale_ref_api_version + spec_scale_ref_kind: + description: + - Kind of the referent; + aliases: + - scale_ref_kind + spec_scale_ref_name: + description: + - Name of the referent; + aliases: + - scale_ref_name + spec_scale_ref_subresource: + description: + - Subresource name of the referent + aliases: + - scale_ref_subresource + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +horizontal_pod_autoscaler: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - behaviour of autoscaler. + type: complex + contains: + cpu_utilization: + description: + - target average CPU utilization (represented as a percentage of requested + CPU) over all the pods; if not specified it defaults to the target CPU + utilization at 80% of the requested resources. + type: complex + contains: + target_percentage: + description: + - fraction of the requested CPU that should be utilized/used, e.g. 70 + means that 70% of the requested CPU should be in use. + type: int + max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; + cannot be smaller than MinReplicas. + type: int + min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, + default 1. + type: int + scale_ref: + description: + - reference to Scale subresource; horizontal pod autoscaler will learn the + current resource consumption from its status, and will set the desired + number of pods by modifying its spec. + type: complex + contains: + api_version: + description: + - API version of the referent + type: str + kind: + description: + - Kind of the referent; + type: str + name: + description: + - Name of the referent; + type: str + subresource: + description: + - Subresource name of the referent + type: str + status: + description: + - current information about the autoscaler. + type: complex + contains: + current_cpu_utilization_percentage: + description: + - current average CPU utilization over all pods, represented as a percentage + of requested CPU, e.g. 70 means that an average pod is using now 70% of + its requested CPU. + type: int + current_replicas: + description: + - current number of replicas of pods managed by this autoscaler. + type: int + desired_replicas: + description: + - desired number of replicas of pods managed by this autoscaler. + type: int + last_scale_time: + description: + - last time the HorizontalPodAutoscaler scaled the number of pods; used + by the autoscaler to control how often the number of pods is changed. + type: complex + contains: {} + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('horizontal_pod_autoscaler', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py b/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py new file mode 100644 index 00000000..10a1a6ab --- /dev/null +++ b/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py @@ -0,0 +1,389 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_horizontal_pod_autoscaler_list +short_description: Kubernetes HorizontalPodAutoscalerList +description: +- Retrieve a list of horizontal_pod_autoscalers. List operations provide a snapshot + read of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +horizontal_pod_autoscaler_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - list of horizontal pod autoscaler objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - behaviour of autoscaler. + type: complex + contains: + cpu_utilization: + description: + - target average CPU utilization (represented as a percentage of requested + CPU) over all the pods; if not specified it defaults to the target + CPU utilization at 80% of the requested resources. + type: complex + contains: + target_percentage: + description: + - fraction of the requested CPU that should be utilized/used, e.g. + 70 means that 70% of the requested CPU should be in use. + type: int + max_replicas: + description: + - upper limit for the number of pods that can be set by the autoscaler; + cannot be smaller than MinReplicas. + type: int + min_replicas: + description: + - lower limit for the number of pods that can be set by the autoscaler, + default 1. + type: int + scale_ref: + description: + - reference to Scale subresource; horizontal pod autoscaler will learn + the current resource consumption from its status, and will set the + desired number of pods by modifying its spec. + type: complex + contains: + api_version: + description: + - API version of the referent + type: str + kind: + description: + - Kind of the referent; + type: str + name: + description: + - Name of the referent; + type: str + subresource: + description: + - Subresource name of the referent + type: str + status: + description: + - current information about the autoscaler. + type: complex + contains: + current_cpu_utilization_percentage: + description: + - current average CPU utilization over all pods, represented as a percentage + of requested CPU, e.g. 70 means that an average pod is using now 70% + of its requested CPU. + type: int + current_replicas: + description: + - current number of replicas of pods managed by this autoscaler. + type: int + desired_replicas: + description: + - desired number of replicas of pods managed by this autoscaler. + type: int + last_scale_time: + description: + - last time the HorizontalPodAutoscaler scaled the number of pods; used + by the autoscaler to control how often the number of pods is changed. + type: complex + contains: {} + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('horizontal_pod_autoscaler_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_ingress.py b/library/k8s_v1beta1_ingress.py new file mode 100644 index 00000000..03589de1 --- /dev/null +++ b/library/k8s_v1beta1_ingress.py @@ -0,0 +1,436 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_ingress +short_description: Kubernetes Ingress +description: +- Manage the lifecycle of a ingress object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_backend_service_name: + description: + - Specifies the name of the referenced service. + aliases: + - backend_service_name + spec_rules: + description: + - A list of host rules used to configure the Ingress. If unspecified, or no rule + matches, all traffic is sent to the default backend. + aliases: + - rules + type: list + spec_tls: + description: + - TLS configuration. Currently the Ingress only supports a single TLS port, 443. + If multiple members of this list specify different hosts, they will be multiplexed + on the same port according to the hostname specified through the SNI TLS extension, + if the ingress controller fulfilling the ingress supports SNI. + aliases: + - tls + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +ingress: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is the desired state of the Ingress. + type: complex + contains: + backend: + description: + - A default backend capable of servicing requests that don't match any rule. + At least one of 'backend' or 'rules' must be specified. This field is + optional to allow the loadbalancer controller or defaulting logic to specify + a global default. + type: complex + contains: + service_name: + description: + - Specifies the name of the referenced service. + type: str + service_port: + description: + - Specifies the port of the referenced service. + type: complex + contains: {} + rules: + description: + - A list of host rules used to configure the Ingress. If unspecified, or + no rule matches, all traffic is sent to the default backend. + type: list + contains: + host: + description: + - 'Host is the fully qualified domain name of a network host, as defined + by RFC 3986. Note the following deviations from the "host" part of + the URI as defined in the RFC: 1. IPs are not allowed. Currently an + IngressRuleValue can only apply to the IP in the Spec of the parent + Ingress. 2. The `:` delimiter is not respected because ports are not + allowed. Currently the port of an Ingress is implicitly :80 for http + and :443 for https. Both these may change in the future. Incoming + requests are matched against the host before the IngressRuleValue. + If the host is unspecified, the Ingress routes all traffic based on + the specified IngressRuleValue.' + type: str + http: + description: [] + type: complex + contains: + paths: + description: + - A collection of paths that map requests to backends. + type: list + contains: + backend: + description: + - Backend defines the referenced service endpoint to which the + traffic will be forwarded to. + type: complex + contains: + service_name: + description: + - Specifies the name of the referenced service. + type: str + service_port: + description: + - Specifies the port of the referenced service. + type: complex + contains: {} + path: + description: + - Path is an extended POSIX regex as defined by IEEE Std 1003.1, + (i.e this follows the egrep/unix syntax, not the perl syntax) + matched against the path of an incoming request. Currently + it can contain characters disallowed from the conventional + "path" part of a URL as defined by RFC 3986. Paths must begin + with a '/'. If unspecified, the path defaults to a catch all + sending traffic to the backend. + type: str + tls: + description: + - TLS configuration. Currently the Ingress only supports a single TLS port, + 443. If multiple members of this list specify different hosts, they will + be multiplexed on the same port according to the hostname specified through + the SNI TLS extension, if the ingress controller fulfilling the ingress + supports SNI. + type: list + contains: + hosts: + description: + - Hosts are a list of hosts included in the TLS certificate. The values + in this list must match the name/s used in the tlsSecret. Defaults + to the wildcard host setting for the loadbalancer controller fulfilling + this Ingress, if left unspecified. + type: list + contains: str + secret_name: + description: + - SecretName is the name of the secret used to terminate SSL traffic + on 443. Field is left optional to allow SSL routing based on SNI hostname + alone. If the SNI host in a listener conflicts with the "Host" header + field used by an IngressRule, the SNI host is used for termination + and value of the Host header is used for routing. + type: str + status: + description: + - Status is the current state of the Ingress. + type: complex + contains: + load_balancer: + description: + - LoadBalancer contains the current status of the load-balancer. + type: complex + contains: + ingress: + description: + - Ingress is a list containing ingress points for the load-balancer. + Traffic intended for the service should be sent to these ingress points. + type: list + contains: + hostname: + description: + - Hostname is set for load-balancer ingress points that are DNS + based (typically AWS load-balancers) + type: str + ip: + description: + - IP is set for load-balancer ingress points that are IP based (typically + GCE or OpenStack load-balancers) + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('ingress', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_ingress_list.py b/library/k8s_v1beta1_ingress_list.py new file mode 100644 index 00000000..1a034e15 --- /dev/null +++ b/library/k8s_v1beta1_ingress_list.py @@ -0,0 +1,437 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_ingress_list +short_description: Kubernetes IngressList +description: +- Retrieve a list of ingress. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +ingress_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Ingress. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec is the desired state of the Ingress. + type: complex + contains: + backend: + description: + - A default backend capable of servicing requests that don't match any + rule. At least one of 'backend' or 'rules' must be specified. This + field is optional to allow the loadbalancer controller or defaulting + logic to specify a global default. + type: complex + contains: + service_name: + description: + - Specifies the name of the referenced service. + type: str + service_port: + description: + - Specifies the port of the referenced service. + type: complex + contains: {} + rules: + description: + - A list of host rules used to configure the Ingress. If unspecified, + or no rule matches, all traffic is sent to the default backend. + type: list + contains: + host: + description: + - 'Host is the fully qualified domain name of a network host, as + defined by RFC 3986. Note the following deviations from the "host" + part of the URI as defined in the RFC: 1. IPs are not allowed. + Currently an IngressRuleValue can only apply to the IP in the + Spec of the parent Ingress. 2. The `:` delimiter is not respected + because ports are not allowed. Currently the port of an Ingress + is implicitly :80 for http and :443 for https. Both these may + change in the future. Incoming requests are matched against the + host before the IngressRuleValue. If the host is unspecified, + the Ingress routes all traffic based on the specified IngressRuleValue.' + type: str + http: + description: [] + type: complex + contains: + paths: + description: + - A collection of paths that map requests to backends. + type: list + contains: + backend: + description: + - Backend defines the referenced service endpoint to which + the traffic will be forwarded to. + type: complex + contains: + service_name: + description: + - Specifies the name of the referenced service. + type: str + service_port: + description: + - Specifies the port of the referenced service. + type: complex + contains: {} + path: + description: + - Path is an extended POSIX regex as defined by IEEE Std + 1003.1, (i.e this follows the egrep/unix syntax, not the + perl syntax) matched against the path of an incoming request. + Currently it can contain characters disallowed from the + conventional "path" part of a URL as defined by RFC 3986. + Paths must begin with a '/'. If unspecified, the path + defaults to a catch all sending traffic to the backend. + type: str + tls: + description: + - TLS configuration. Currently the Ingress only supports a single TLS + port, 443. If multiple members of this list specify different hosts, + they will be multiplexed on the same port according to the hostname + specified through the SNI TLS extension, if the ingress controller + fulfilling the ingress supports SNI. + type: list + contains: + hosts: + description: + - Hosts are a list of hosts included in the TLS certificate. The + values in this list must match the name/s used in the tlsSecret. + Defaults to the wildcard host setting for the loadbalancer controller + fulfilling this Ingress, if left unspecified. + type: list + contains: str + secret_name: + description: + - SecretName is the name of the secret used to terminate SSL traffic + on 443. Field is left optional to allow SSL routing based on SNI + hostname alone. If the SNI host in a listener conflicts with the + "Host" header field used by an IngressRule, the SNI host is used + for termination and value of the Host header is used for routing. + type: str + status: + description: + - Status is the current state of the Ingress. + type: complex + contains: + load_balancer: + description: + - LoadBalancer contains the current status of the load-balancer. + type: complex + contains: + ingress: + description: + - Ingress is a list containing ingress points for the load-balancer. + Traffic intended for the service should be sent to these ingress + points. + type: list + contains: + hostname: + description: + - Hostname is set for load-balancer ingress points that are + DNS based (typically AWS load-balancers) + type: str + ip: + description: + - IP is set for load-balancer ingress points that are IP based + (typically GCE or OpenStack load-balancers) + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('ingress_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_job.py b/library/k8s_v1beta1_job.py new file mode 100644 index 00000000..1e054834 --- /dev/null +++ b/library/k8s_v1beta1_job.py @@ -0,0 +1,2479 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_job +short_description: Kubernetes Job +description: +- Manage the lifecycle of a job object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may be active + before the system tries to terminate it; value must be positive integer + aliases: + - active_deadline_seconds + type: int + spec_auto_selector: + description: + - AutoSelector controls generation of pod labels and pod selectors. It was not + present in the original extensions/v1beta1 Job definition, but exists to allow + conversion from batch/v1 Jobs, where it corresponds to, but has the opposite + meaning as, ManualSelector. + aliases: + - auto_selector + type: bool + spec_completions: + description: + - Completions specifies the desired number of successfully finished pods the job + should be run with. Setting to nil means that the success of any pod signals + the success of all pods, and allows parallelism to have any positive value. + Setting to 1 means that parallelism is limited to 1 and the success of that + pod signals the success of the job. + aliases: + - completions + type: int + spec_parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should run + at any given time. The actual number of pods running in steady state will be + less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), + i.e. when the work left to do is less than max parallelism. + aliases: + - parallelism + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may + be active before the system tries to terminate it; value must be positive + integer + type: int + auto_selector: + description: + - AutoSelector controls generation of pod labels and pod selectors. It was + not present in the original extensions/v1beta1 Job definition, but exists + to allow conversion from batch/v1 Jobs, where it corresponds to, but has + the opposite meaning as, ManualSelector. + type: bool + completions: + description: + - Completions specifies the desired number of successfully finished pods + the job should be run with. Setting to nil means that the success of any + pod signals the success of all pods, and allows parallelism to have any + positive value. Setting to 1 means that parallelism is limited to 1 and + the success of that pod signals the success of the job. + type: int + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady state + will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. Normally, + the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created when + executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not guaranteed + to be set in happens-before order across separate operations. It is represented + in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job Manager. + It is not guaranteed to be set in happens-before order across separate + operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_job_list.py b/library/k8s_v1beta1_job_list.py new file mode 100644 index 00000000..5cbfbe1d --- /dev/null +++ b/library/k8s_v1beta1_job_list.py @@ -0,0 +1,2302 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_job_list +short_description: Kubernetes JobList +description: +- Retrieve a list of jobs. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Job. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job + may be active before the system tries to terminate it; value must + be positive integer + type: int + auto_selector: + description: + - AutoSelector controls generation of pod labels and pod selectors. + It was not present in the original extensions/v1beta1 Job definition, + but exists to allow conversion from batch/v1 Jobs, where it corresponds + to, but has the opposite meaning as, ManualSelector. + type: bool + completions: + description: + - Completions specifies the desired number of successfully finished + pods the job should be run with. Setting to nil means that the success + of any pod signals the success of all pods, and allows parallelism + to have any positive value. Setting to 1 means that parallelism is + limited to 1 and the success of that pod signals the success of the + job. + type: int + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady + state will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max + parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. + Normally, the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + when executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not + guaranteed to be set in happens-before order across separate operations. + It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job + Manager. It is not guaranteed to be set in happens-before order across + separate operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_network_policy.py b/library/k8s_v1beta1_network_policy.py new file mode 100644 index 00000000..a7c3572b --- /dev/null +++ b/library/k8s_v1beta1_network_policy.py @@ -0,0 +1,492 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_network_policy +short_description: Kubernetes NetworkPolicy +description: +- Manage the lifecycle of a network_policy object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_ingress: + description: + - List of ingress rules to be applied to the selected pods. Traffic is allowed + to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster + policy allows it, OR if the traffic source is the pod's local node, OR if the + traffic matches at least one ingress rule across all of the NetworkPolicy objects + whose podSelector matches the pod. If this field is empty then this NetworkPolicy + does not affect ingress isolation. If this field is present and contains at + least one rule, this policy allows any traffic which matches at least one of + the ingress rules in this list. + aliases: + - ingress + type: list + spec_pod_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - pod_selector_match_expressions + type: list + spec_pod_selector_match_labels: + description: + - 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. + aliases: + - pod_selector_match_labels + type: dict + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +network_policy: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior for this NetworkPolicy. + type: complex + contains: + ingress: + description: + - List of ingress rules to be applied to the selected pods. Traffic is allowed + to a pod if namespace.networkPolicy.ingress.isolation is undefined and + cluster policy allows it, OR if the traffic source is the pod's local + node, OR if the traffic matches at least one ingress rule across all of + the NetworkPolicy objects whose podSelector matches the pod. If this field + is empty then this NetworkPolicy does not affect ingress isolation. If + this field is present and contains at least one rule, this policy allows + any traffic which matches at least one of the ingress rules in this list. + type: list + contains: + _from: + description: + - List of sources which should be able to access the pods selected for + this rule. Items in this list are combined using a logical OR operation. + If this field is not provided, this rule matches all sources (traffic + not restricted by source). If this field is empty, this rule matches + no sources (no traffic matches). If this field is present and contains + at least on item, this rule allows traffic only if the traffic matches + at least one item in the from list. + type: list + contains: + namespace_selector: + description: + - Selects Namespaces using cluster scoped-labels. This matches all + pods in all namespaces selected by this label selector. This field + follows standard label selector semantics. If omitted, this selector + selects no namespaces. If present but empty, this selector selects + all namespaces. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + pod_selector: + description: + - This is a label selector which selects Pods in this namespace. + This field follows standard label selector semantics. If not provided, + this selector selects no pods. If present but empty, this selector + selects all pods in this namespace. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + ports: + description: + - List of ports which should be made accessible on the pods selected + for this rule. Each item in this list is combined using a logical + OR. If this field is not provided, this rule matches all ports (traffic + not restricted by port). If this field is empty, this rule matches + no ports (no traffic matches). If this field is present and contains + at least one item, then this rule allows traffic only if the traffic + matches at least one port in the list. + type: list + contains: + port: + description: + - If specified, the port on the given protocol. This can either + be a numerical or named port on a pod. If this field is not provided, + this matches all port names and numbers. If present, only traffic + on the specified protocol AND port will be matched. + type: complex + contains: {} + protocol: + description: + - Optional. The protocol (TCP or UDP) which traffic must match. + If not specified, this field defaults to TCP. + type: str + pod_selector: + description: + - Selects the pods to which this NetworkPolicy object applies. The array + of ingress rules is applied to any pods selected by this field. Multiple + network policies can select the same set of pods. In this case, the ingress + rules for each are combined additively. This field is NOT optional and + follows standard label selector semantics. An empty podSelector matches + all pods in this namespace. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('network_policy', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_network_policy_list.py b/library/k8s_v1beta1_network_policy_list.py new file mode 100644 index 00000000..33c96192 --- /dev/null +++ b/library/k8s_v1beta1_network_policy_list.py @@ -0,0 +1,490 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_network_policy_list +short_description: Kubernetes NetworkPolicyList +description: +- Retrieve a list of network_policys. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +network_policy_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of schema objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior for this NetworkPolicy. + type: complex + contains: + ingress: + description: + - List of ingress rules to be applied to the selected pods. Traffic + is allowed to a pod if namespace.networkPolicy.ingress.isolation is + undefined and cluster policy allows it, OR if the traffic source is + the pod's local node, OR if the traffic matches at least one ingress + rule across all of the NetworkPolicy objects whose podSelector matches + the pod. If this field is empty then this NetworkPolicy does not affect + ingress isolation. If this field is present and contains at least + one rule, this policy allows any traffic which matches at least one + of the ingress rules in this list. + type: list + contains: + _from: + description: + - List of sources which should be able to access the pods selected + for this rule. Items in this list are combined using a logical + OR operation. If this field is not provided, this rule matches + all sources (traffic not restricted by source). If this field + is empty, this rule matches no sources (no traffic matches). If + this field is present and contains at least on item, this rule + allows traffic only if the traffic matches at least one item in + the from list. + type: list + contains: + namespace_selector: + description: + - Selects Namespaces using cluster scoped-labels. This matches + all pods in all namespaces selected by this label selector. + This field follows standard label selector semantics. If omitted, + this selector selects no namespaces. If present but empty, + this selector selects all namespaces. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set + of values. Valid operators ard In, NotIn, Exists and + DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator + is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during + a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + pod_selector: + description: + - This is a label selector which selects Pods in this namespace. + This field follows standard label selector semantics. If not + provided, this selector selects no pods. If present but empty, + this selector selects all pods in this namespace. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set + of values. Valid operators ard In, NotIn, Exists and + DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator + is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during + a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + ports: + description: + - List of ports which should be made accessible on the pods selected + for this rule. Each item in this list is combined using a logical + OR. If this field is not provided, this rule matches all ports + (traffic not restricted by port). If this field is empty, this + rule matches no ports (no traffic matches). If this field is present + and contains at least one item, then this rule allows traffic + only if the traffic matches at least one port in the list. + type: list + contains: + port: + description: + - If specified, the port on the given protocol. This can either + be a numerical or named port on a pod. If this field is not + provided, this matches all port names and numbers. If present, + only traffic on the specified protocol AND port will be matched. + type: complex + contains: {} + protocol: + description: + - Optional. The protocol (TCP or UDP) which traffic must match. + If not specified, this field defaults to TCP. + type: str + pod_selector: + description: + - Selects the pods to which this NetworkPolicy object applies. The array + of ingress rules is applied to any pods selected by this field. Multiple + network policies can select the same set of pods. In this case, the + ingress rules for each are combined additively. This field is NOT + optional and follows standard label selector semantics. An empty podSelector + matches all pods in this namespace. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('network_policy_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_pod_disruption_budget.py b/library/k8s_v1beta1_pod_disruption_budget.py new file mode 100644 index 00000000..035a37ad --- /dev/null +++ b/library/k8s_v1beta1_pod_disruption_budget.py @@ -0,0 +1,396 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_pod_disruption_budget +short_description: Kubernetes PodDisruptionBudget +description: +- Manage the lifecycle of a pod_disruption_budget object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_disruption_budget: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the PodDisruptionBudget. + type: complex + contains: + min_available: + description: + - An eviction is allowed if at least "minAvailable" pods selected by "selector" + will still be available after the eviction, i.e. even in the absence of + the evicted pod. So for example you can prevent all voluntary evictions + by specifying "100%". + type: complex + contains: {} + selector: + description: + - Label query over pods whose evictions are managed by the disruption budget. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Most recently observed status of the PodDisruptionBudget. + type: complex + contains: + current_healthy: + description: + - current number of healthy pods + type: int + desired_healthy: + description: + - minimum desired number of healthy pods + type: int + disrupted_pods: + description: + - DisruptedPods contains information about pods whose eviction was processed + by the API server eviction subresource handler but has not yet been observed + by the PodDisruptionBudget controller. A pod will be in this map from + the time when the API server processed the eviction request to the time + when the pod is seen by PDB controller as having been marked for deletion + (or after a timeout). The key in the map is the name of the pod and the + value is the time when the API server processed the eviction request. + If the deletion didn't occur and a pod is still there it will be removed + from the list automatically by PodDisruptionBudget controller after some + time. If everything goes smooth this map should be empty for the most + of the time. Large number of entries in the map may indicate problems + with pod deletions. + type: complex + contains: str, UnversionedTime + disruptions_allowed: + description: + - Number of pod disruptions that are currently allowed. + type: int + expected_pods: + description: + - total number of pods counted by this disruption budget + type: int + observed_generation: + description: + - Most recent generation observed when updating this PDB status. PodDisruptionsAllowed + and other status informatio is valid only if observedGeneration equals + to PDB's object generation. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_disruption_budget', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_pod_disruption_budget_list.py b/library/k8s_v1beta1_pod_disruption_budget_list.py new file mode 100644 index 00000000..5712a11e --- /dev/null +++ b/library/k8s_v1beta1_pod_disruption_budget_list.py @@ -0,0 +1,400 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_pod_disruption_budget_list +short_description: Kubernetes PodDisruptionBudgetList +description: +- Retrieve a list of pod_disruption_budgets. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_disruption_budget_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: [] + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the PodDisruptionBudget. + type: complex + contains: + min_available: + description: + - An eviction is allowed if at least "minAvailable" pods selected by + "selector" will still be available after the eviction, i.e. even in + the absence of the evicted pod. So for example you can prevent all + voluntary evictions by specifying "100%". + type: complex + contains: {} + selector: + description: + - Label query over pods whose evictions are managed by the disruption + budget. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + status: + description: + - Most recently observed status of the PodDisruptionBudget. + type: complex + contains: + current_healthy: + description: + - current number of healthy pods + type: int + desired_healthy: + description: + - minimum desired number of healthy pods + type: int + disrupted_pods: + description: + - DisruptedPods contains information about pods whose eviction was processed + by the API server eviction subresource handler but has not yet been + observed by the PodDisruptionBudget controller. A pod will be in this + map from the time when the API server processed the eviction request + to the time when the pod is seen by PDB controller as having been + marked for deletion (or after a timeout). The key in the map is the + name of the pod and the value is the time when the API server processed + the eviction request. If the deletion didn't occur and a pod is still + there it will be removed from the list automatically by PodDisruptionBudget + controller after some time. If everything goes smooth this map should + be empty for the most of the time. Large number of entries in the + map may indicate problems with pod deletions. + type: complex + contains: str, UnversionedTime + disruptions_allowed: + description: + - Number of pod disruptions that are currently allowed. + type: int + expected_pods: + description: + - total number of pods counted by this disruption budget + type: int + observed_generation: + description: + - Most recent generation observed when updating this PDB status. PodDisruptionsAllowed + and other status informatio is valid only if observedGeneration equals + to PDB's object generation. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_disruption_budget_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_pod_security_policy.py b/library/k8s_v1beta1_pod_security_policy.py new file mode 100644 index 00000000..e03ebedc --- /dev/null +++ b/library/k8s_v1beta1_pod_security_policy.py @@ -0,0 +1,603 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_pod_security_policy +short_description: Kubernetes PodSecurityPolicy +description: +- Manage the lifecycle of a pod_security_policy object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested to add to + the container. Capabilities in this field may be added at the pod author's discretion. + You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. + aliases: + - allowed_capabilities + type: list + spec_default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will be added + to the container unless the pod spec specifically drops the capability. You + may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities. + aliases: + - default_add_capabilities + type: list + spec_fs_group_ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like to force a single + fs group then supply a single range with the same start and end. + aliases: + - fs_group_ranges + type: list + spec_fs_group_rule: + description: + - Rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + aliases: + - fs_group_rule + spec_host_ipc: + description: + - hostIPC determines if the policy allows the use of HostIPC in the pod spec. + aliases: + - host_ipc + type: bool + spec_host_network: + description: + - hostNetwork determines if the policy allows the use of HostNetwork in the pod + spec. + aliases: + - host_network + type: bool + spec_host_pid: + description: + - hostPID determines if the policy allows the use of HostPID in the pod spec. + aliases: + - host_pid + type: bool + spec_host_ports: + description: + - hostPorts determines which host port ranges are allowed to be exposed. + aliases: + - host_ports + type: list + spec_privileged: + description: + - privileged determines if a pod can request to be run as privileged. + aliases: + - privileged + type: bool + spec_read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run with a + read only root file system. If the container specifically requests to run with + a non-read only root file system the PSP should deny the pod. If set to false + the container may run with a read only root file system if it wishes but it + will not be forced to. + aliases: + - read_only_root_filesystem + type: bool + spec_required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped from the + container. These are required to be dropped and cannot be added. + aliases: + - required_drop_capabilities + type: list + spec_run_as_user_ranges: + description: + - Ranges are the allowed ranges of uids that may be used. + aliases: + - run_as_user_ranges + type: list + spec_run_as_user_rule: + description: + - Rule is the strategy that will dictate the allowable RunAsUser values that may + be set. + aliases: + - run_as_user_rule + spec_se_linux_rule: + description: + - type is the strategy that will dictate the allowable labels that may be set. + aliases: + - se_linux_rule + spec_se_linux_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - se_linux_se_options_level + spec_se_linux_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - se_linux_se_options_role + spec_se_linux_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - se_linux_se_options_type + spec_se_linux_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - se_linux_se_options_user + spec_supplemental_groups_ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would like to force + a single supplemental group then supply a single range with the same start and + end. + aliases: + - supplemental_groups_ranges + type: list + spec_supplemental_groups_rule: + description: + - Rule is the strategy that will dictate what supplemental groups is used in the + SecurityContext. + aliases: + - supplemental_groups_rule + spec_volumes: + description: + - volumes is a white list of allowed volume plugins. Empty indicates that all + plugins may be used. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_security_policy: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - spec defines the policy enforced. + type: complex + contains: + allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested to + add to the container. Capabilities in this field may be added at the pod + author's discretion. You must not list a capability in both AllowedCapabilities + and RequiredDropCapabilities. + type: list + contains: str + default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will be + added to the container unless the pod spec specifically drops the capability. + You may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities. + type: list + contains: str + fs_group: + description: + - FSGroup is the strategy that will dictate what fs group is used by the + SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like to force + a single fs group then supply a single range with the same start and + end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate what FSGroup is used in the + SecurityContext. + type: str + host_ipc: + description: + - hostIPC determines if the policy allows the use of HostIPC in the pod + spec. + type: bool + host_network: + description: + - hostNetwork determines if the policy allows the use of HostNetwork in + the pod spec. + type: bool + host_pid: + description: + - hostPID determines if the policy allows the use of HostPID in the pod + spec. + type: bool + host_ports: + description: + - hostPorts determines which host port ranges are allowed to be exposed. + type: list + contains: + max: + description: + - max is the end of the range, inclusive. + type: int + min: + description: + - min is the start of the range, inclusive. + type: int + privileged: + description: + - privileged determines if a pod can request to be run as privileged. + type: bool + read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run with + a read only root file system. If the container specifically requests to + run with a non-read only root file system the PSP should deny the pod. + If set to false the container may run with a read only root file system + if it wishes but it will not be forced to. + type: bool + required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped from + the container. These are required to be dropped and cannot be added. + type: list + contains: str + run_as_user: + description: + - runAsUser is the strategy that will dictate the allowable RunAsUser values + that may be set. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of uids that may be used. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate the allowable RunAsUser values + that may be set. + type: str + se_linux: + description: + - seLinux is the strategy that will dictate the allowable labels that may + be set. + type: complex + contains: + rule: + description: + - type is the strategy that will dictate the allowable labels that may + be set. + type: str + se_linux_options: + description: + - seLinuxOptions required to run as; required for MustRunAs + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - SupplementalGroups is the strategy that will dictate what supplemental + groups are used by the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would + like to force a single supplemental group then supply a single range + with the same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate what supplemental groups is + used in the SecurityContext. + type: str + volumes: + description: + - volumes is a white list of allowed volume plugins. Empty indicates that + all plugins may be used. + type: list + contains: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_security_policy', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_pod_security_policy_list.py b/library/k8s_v1beta1_pod_security_policy_list.py new file mode 100644 index 00000000..83ae312b --- /dev/null +++ b/library/k8s_v1beta1_pod_security_policy_list.py @@ -0,0 +1,492 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_pod_security_policy_list +short_description: Kubernetes PodSecurityPolicyList +description: +- Retrieve a list of pod_security_policys. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +pod_security_policy_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is a list of schema objects. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - spec defines the policy enforced. + type: complex + contains: + allowed_capabilities: + description: + - AllowedCapabilities is a list of capabilities that can be requested + to add to the container. Capabilities in this field may be added at + the pod author's discretion. You must not list a capability in both + AllowedCapabilities and RequiredDropCapabilities. + type: list + contains: str + default_add_capabilities: + description: + - DefaultAddCapabilities is the default set of capabilities that will + be added to the container unless the pod spec specifically drops the + capability. You may not list a capabiility in both DefaultAddCapabilities + and RequiredDropCapabilities. + type: list + contains: str + fs_group: + description: + - FSGroup is the strategy that will dictate what fs group is used by + the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of fs groups. If you would like + to force a single fs group then supply a single range with the + same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate what FSGroup is used in + the SecurityContext. + type: str + host_ipc: + description: + - hostIPC determines if the policy allows the use of HostIPC in the + pod spec. + type: bool + host_network: + description: + - hostNetwork determines if the policy allows the use of HostNetwork + in the pod spec. + type: bool + host_pid: + description: + - hostPID determines if the policy allows the use of HostPID in the + pod spec. + type: bool + host_ports: + description: + - hostPorts determines which host port ranges are allowed to be exposed. + type: list + contains: + max: + description: + - max is the end of the range, inclusive. + type: int + min: + description: + - min is the start of the range, inclusive. + type: int + privileged: + description: + - privileged determines if a pod can request to be run as privileged. + type: bool + read_only_root_filesystem: + description: + - ReadOnlyRootFilesystem when set to true will force containers to run + with a read only root file system. If the container specifically requests + to run with a non-read only root file system the PSP should deny the + pod. If set to false the container may run with a read only root file + system if it wishes but it will not be forced to. + type: bool + required_drop_capabilities: + description: + - RequiredDropCapabilities are the capabilities that will be dropped + from the container. These are required to be dropped and cannot be + added. + type: list + contains: str + run_as_user: + description: + - runAsUser is the strategy that will dictate the allowable RunAsUser + values that may be set. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of uids that may be used. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate the allowable RunAsUser + values that may be set. + type: str + se_linux: + description: + - seLinux is the strategy that will dictate the allowable labels that + may be set. + type: complex + contains: + rule: + description: + - type is the strategy that will dictate the allowable labels that + may be set. + type: str + se_linux_options: + description: + - seLinuxOptions required to run as; required for MustRunAs + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - SupplementalGroups is the strategy that will dictate what supplemental + groups are used by the SecurityContext. + type: complex + contains: + ranges: + description: + - Ranges are the allowed ranges of supplemental groups. If you would + like to force a single supplemental group then supply a single + range with the same start and end. + type: list + contains: + max: + description: + - Max is the end of the range, inclusive. + type: int + min: + description: + - Min is the start of the range, inclusive. + type: int + rule: + description: + - Rule is the strategy that will dictate what supplemental groups + is used in the SecurityContext. + type: str + volumes: + description: + - volumes is a white list of allowed volume plugins. Empty indicates + that all plugins may be used. + type: list + contains: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('pod_security_policy_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_replica_set.py b/library/k8s_v1beta1_replica_set.py new file mode 100644 index 00000000..ca8d49f5 --- /dev/null +++ b/library/k8s_v1beta1_replica_set.py @@ -0,0 +1,2438 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_replica_set +short_description: Kubernetes ReplicaSet +description: +- Manage the lifecycle of a replica_set object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready without + any of its container crashing, for it to be considered available. Defaults to + 0 (pod will be considered available as soon as it is ready) + aliases: + - min_ready_seconds + type: int + spec_replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + aliases: + - replicas + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +replica_set: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - If the Labels of a ReplicaSet are empty, they are defaulted to be the same + as the Pod(s) that the ReplicaSet manages. Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the specification of the desired behavior of the ReplicaSet. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be ready + without any of its container crashing, for it to be considered available. + Defaults to 0 (pod will be considered available as soon as it is ready) + type: int + replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the replica count. + If the selector is empty, it is defaulted to the labels present on the + pod template. Label keys and values that must match in order to be controlled + by this replica set. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created if + insufficient replicas are detected. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the most recently observed status of the ReplicaSet. This data may + be out of date by some window of time. Populated by the system. Read-only. + type: complex + contains: + available_replicas: + description: + - The number of available replicas (ready for at least minReadySeconds) + for this replica set. + type: int + conditions: + description: + - Represents the latest available observations of a replica set's current + state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of replica set condition. + type: str + fully_labeled_replicas: + description: + - The number of pods that have labels matching the labels of the pod template + of the replicaset. + type: int + observed_generation: + description: + - ObservedGeneration reflects the generation of the most recently observed + ReplicaSet. + type: int + ready_replicas: + description: + - The number of ready replicas for this replica set. + type: int + replicas: + description: + - Replicas is the most recently oberved number of replicas. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('replica_set', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_replica_set_list.py b/library/k8s_v1beta1_replica_set_list.py new file mode 100644 index 00000000..e38b2702 --- /dev/null +++ b/library/k8s_v1beta1_replica_set_list.py @@ -0,0 +1,2280 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_replica_set_list +short_description: Kubernetes ReplicaSetList +description: +- Retrieve a list of replica_sets. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +replica_set_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - List of ReplicaSets. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - If the Labels of a ReplicaSet are empty, they are defaulted to be the + same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the specification of the desired behavior of the ReplicaSet. + type: complex + contains: + min_ready_seconds: + description: + - Minimum number of seconds for which a newly created pod should be + ready without any of its container crashing, for it to be considered + available. Defaults to 0 (pod will be considered available as soon + as it is ready) + type: int + replicas: + description: + - Replicas is the number of desired replicas. This is a pointer to distinguish + between explicit zero and unspecified. Defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the replica + count. If the selector is empty, it is defaulted to the labels present + on the pod template. Label keys and values that must match in order + to be controlled by this replica set. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + if insufficient replicas are detected. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is the most recently observed status of the ReplicaSet. This data + may be out of date by some window of time. Populated by the system. Read-only. + type: complex + contains: + available_replicas: + description: + - The number of available replicas (ready for at least minReadySeconds) + for this replica set. + type: int + conditions: + description: + - Represents the latest available observations of a replica set's current + state. + type: list + contains: + last_transition_time: + description: + - The last time the condition transitioned from one status to another. + type: complex + contains: {} + message: + description: + - A human readable message indicating details about the transition. + type: str + reason: + description: + - The reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of replica set condition. + type: str + fully_labeled_replicas: + description: + - The number of pods that have labels matching the labels of the pod + template of the replicaset. + type: int + observed_generation: + description: + - ObservedGeneration reflects the generation of the most recently observed + ReplicaSet. + type: int + ready_replicas: + description: + - The number of ready replicas for this replica set. + type: int + replicas: + description: + - Replicas is the most recently oberved number of replicas. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('replica_set_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_scale.py b/library/k8s_v1beta1_scale.py new file mode 100644 index 00000000..26d15cab --- /dev/null +++ b/library/k8s_v1beta1_scale.py @@ -0,0 +1,315 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_scale +short_description: Kubernetes Scale +description: +- Manage the lifecycle of a scale object. Supports check mode, and attempts to to + be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_replicas: + description: + - desired number of instances for the scaled object. + aliases: + - replicas + type: int + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +scale: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata; + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - defines the behavior of the scale. + type: complex + contains: + replicas: + description: + - desired number of instances for the scaled object. + type: int + status: + description: + - current status of the scale. + type: complex + contains: + replicas: + description: + - actual number of observed instances of the scaled object. + type: int + selector: + description: + - label query over pods that should match the replicas count. + type: complex + contains: str, str + target_selector: + description: + - label selector for pods that should match the replicas count. This is + a serializated version of both map-based and more expressive set-based + selectors. This is done to avoid introspection in the clients. The string + will be in the same format as the query-param syntax. If the target type + only supports map-based selectors, both this field and map-based selector + field are populated. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('scale', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_stateful_set.py b/library/k8s_v1beta1_stateful_set.py new file mode 100644 index 00000000..985b6d53 --- /dev/null +++ b/library/k8s_v1beta1_stateful_set.py @@ -0,0 +1,2688 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_stateful_set +short_description: Kubernetes StatefulSet +description: +- Manage the lifecycle of a stateful_set object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_replicas: + description: + - Replicas is the desired number of replicas of the given Template. These are + replicas in the sense that they are instantiations of the same Template, but + individual replicas also have a consistent identity. If unspecified, defaults + to 1. + aliases: + - replicas + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_service_name: + description: + - 'ServiceName is the name of the service that governs this StatefulSet. This + service must exist before the StatefulSet, and is responsible for the network + identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local + where "pod-specific-string" is managed by the StatefulSet controller.' + aliases: + - service_name + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + spec_volume_claim_templates: + description: + - VolumeClaimTemplates is a list of claims that pods are allowed to reference. + The StatefulSet controller is responsible for mapping network identities to + claims in a way that maintains the identity of a pod. Every claim in this list + must have at least one matching (by name) volumeMount in one container in the + template. A claim in this list takes precedence over any volumes in the template, + with the same name. + aliases: + - volume_claim_templates + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +stateful_set: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired identities of pods in this set. + type: complex + contains: + replicas: + description: + - Replicas is the desired number of replicas of the given Template. These + are replicas in the sense that they are instantiations of the same Template, + but individual replicas also have a consistent identity. If unspecified, + defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the replica count. + If empty, defaulted to labels on the pod template. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + service_name: + description: + - 'ServiceName is the name of the service that governs this StatefulSet. + This service must exist before the StatefulSet, and is responsible for + the network identity of the set. Pods get DNS/hostnames that follow the + pattern: pod-specific-string.serviceName.default.svc.cluster.local where + "pod-specific-string" is managed by the StatefulSet controller.' + type: str + template: + description: + - Template is the object that describes the pod that will be created if + insufficient replicas are detected. Each pod stamped out by the StatefulSet + will fulfill this Template, but have a unique identity from the rest of + the StatefulSet. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + volume_claim_templates: + description: + - VolumeClaimTemplates is a list of claims that pods are allowed to reference. + The StatefulSet controller is responsible for mapping network identities + to claims in a way that maintains the identity of a pod. Every claim in + this list must have at least one matching (by name) volumeMount in one + container in the template. A claim in this list takes precedence over + any volumes in the template, with the same name. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of + an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired characteristics of a volume requested by + a pod author. + type: complex + contains: + access_modes: + description: + - AccessModes contains the desired access modes the volume should + have. + type: list + contains: str + resources: + description: + - Resources represents the minimum resources the volume should have. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to an + implementation-defined value. + type: complex + contains: str, ResourceQuantity + selector: + description: + - A label query over volumes to consider for binding. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + volume_name: + description: + - VolumeName is the binding reference to the PersistentVolume backing + this claim. + type: str + status: + description: + - Status represents the current information/status of a persistent volume + claim. Read-only. + type: complex + contains: + access_modes: + description: + - AccessModes contains the actual access modes the volume backing + the PVC has. + type: list + contains: str + capacity: + description: + - Represents the actual resources of the underlying volume. + type: complex + contains: str, ResourceQuantity + phase: + description: + - Phase represents the current phase of PersistentVolumeClaim. + type: str + status: + description: + - Status is the current status of Pods in this StatefulSet. This data may be + out of date by some window of time. + type: complex + contains: + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int + replicas: + description: + - Replicas is the number of actual replicas. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('stateful_set', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_stateful_set_list.py b/library/k8s_v1beta1_stateful_set_list.py new file mode 100644 index 00000000..8e47a3ac --- /dev/null +++ b/library/k8s_v1beta1_stateful_set_list.py @@ -0,0 +1,2525 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_stateful_set_list +short_description: Kubernetes StatefulSetList +description: +- Retrieve a list of stateful_sets. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +stateful_set_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: [] + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec defines the desired identities of pods in this set. + type: complex + contains: + replicas: + description: + - Replicas is the desired number of replicas of the given Template. + These are replicas in the sense that they are instantiations of the + same Template, but individual replicas also have a consistent identity. + If unspecified, defaults to 1. + type: int + selector: + description: + - Selector is a label query over pods that should match the replica + count. If empty, defaulted to labels on the pod template. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + service_name: + description: + - 'ServiceName is the name of the service that governs this StatefulSet. + This service must exist before the StatefulSet, and is responsible + for the network identity of the set. Pods get DNS/hostnames that follow + the pattern: pod-specific-string.serviceName.default.svc.cluster.local + where "pod-specific-string" is managed by the StatefulSet controller.' + type: str + template: + description: + - Template is the object that describes the pod that will be created + if insufficient replicas are detected. Each pod stamped out by the + StatefulSet will fulfill this Template, but have a unique identity + from the rest of the StatefulSet. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + volume_claim_templates: + description: + - VolumeClaimTemplates is a list of claims that pods are allowed to + reference. The StatefulSet controller is responsible for mapping network + identities to claims in a way that maintains the identity of a pod. + Every claim in this list must have at least one matching (by name) + volumeMount in one container in the template. A claim in this list + takes precedence over any volumes in the template, with the same name. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the + latest internal value, and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object + represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Spec defines the desired characteristics of a volume requested + by a pod author. + type: complex + contains: + access_modes: + description: + - AccessModes contains the desired access modes the volume should + have. + type: list + contains: str + resources: + description: + - Resources represents the minimum resources the volume should + have. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + selector: + description: + - A label query over volumes to consider for binding. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set + of values. Valid operators ard In, NotIn, Exists and + DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator + is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during + a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + volume_name: + description: + - VolumeName is the binding reference to the PersistentVolume + backing this claim. + type: str + status: + description: + - Status represents the current information/status of a persistent + volume claim. Read-only. + type: complex + contains: + access_modes: + description: + - AccessModes contains the actual access modes the volume backing + the PVC has. + type: list + contains: str + capacity: + description: + - Represents the actual resources of the underlying volume. + type: complex + contains: str, ResourceQuantity + phase: + description: + - Phase represents the current phase of PersistentVolumeClaim. + type: str + status: + description: + - Status is the current status of Pods in this StatefulSet. This data may + be out of date by some window of time. + type: complex + contains: + observed_generation: + description: + - most recent generation observed by this autoscaler. + type: int + replicas: + description: + - Replicas is the number of actual replicas. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('stateful_set_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_storage_class.py b/library/k8s_v1beta1_storage_class.py new file mode 100644 index 00000000..8462a669 --- /dev/null +++ b/library/k8s_v1beta1_storage_class.py @@ -0,0 +1,307 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_storage_class +short_description: Kubernetes StorageClass +description: +- Manage the lifecycle of a storage_class object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + parameters: + description: + - Parameters holds the parameters for the provisioner that should create volumes + of this storage class. + type: dict + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + provisioner: + description: + - Provisioner indicates the type of the provisioner. + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +storage_class: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + parameters: + description: + - Parameters holds the parameters for the provisioner that should create volumes + of this storage class. + type: complex + contains: str, str + provisioner: + description: + - Provisioner indicates the type of the provisioner. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('storage_class', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_storage_class_list.py b/library/k8s_v1beta1_storage_class_list.py new file mode 100644 index 00000000..ce8e7b15 --- /dev/null +++ b/library/k8s_v1beta1_storage_class_list.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_storage_class_list +short_description: Kubernetes StorageClassList +description: +- Retrieve a list of storage_class. List operations provide a snapshot read of the + underlying objects, returning a resource_version representing a consistent version + of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +storage_class_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of StorageClasses + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + parameters: + description: + - Parameters holds the parameters for the provisioner that should create + volumes of this storage class. + type: complex + contains: str, str + provisioner: + description: + - Provisioner indicates the type of the provisioner. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('storage_class_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_third_party_resource.py b/library/k8s_v1beta1_third_party_resource.py new file mode 100644 index 00000000..80f9e1f6 --- /dev/null +++ b/library/k8s_v1beta1_third_party_resource.py @@ -0,0 +1,309 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_third_party_resource +short_description: Kubernetes ThirdPartyResource +description: +- Manage the lifecycle of a third_party_resource object. Supports check mode, and + attempts to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + description: + description: + - Description is the description of this object. + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool + versions: + description: + - Versions are versions for this third party object + type: list +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +third_party_resource: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + description: + description: + - Description is the description of this object. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + versions: + description: + - Versions are versions for this third party object + type: list + contains: + name: + description: + - Name of this version (e.g. 'v1'). + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('third_party_resource', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_third_party_resource_list.py b/library/k8s_v1beta1_third_party_resource_list.py new file mode 100644 index 00000000..c50c2968 --- /dev/null +++ b/library/k8s_v1beta1_third_party_resource_list.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_third_party_resource_list +short_description: Kubernetes ThirdPartyResourceList +description: +- Retrieve a list of third_party_resources. List operations provide a snapshot read + of the underlying objects, returning a resource_version representing a consistent + version of the listed objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +third_party_resource_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of ThirdPartyResources. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + description: + description: + - Description is the description of this object. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object metadata + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + versions: + description: + - Versions are versions for this third party object + type: list + contains: + name: + description: + - Name of this version (e.g. 'v1'). + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata. + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('third_party_resource_list', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v1beta1_token_review.py b/library/k8s_v1beta1_token_review.py new file mode 100644 index 00000000..fa5d2325 --- /dev/null +++ b/library/k8s_v1beta1_token_review.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v1beta1_token_review +short_description: Kubernetes TokenReview +description: +- Manage the lifecycle of a token_review object. Supports check mode, and attempts + to to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_token: + description: + - Token is the opaque bearer token. + aliases: + - token + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +token_review: + type: complex + returned: on success + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: [] + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec holds information about the request being evaluated + type: complex + contains: + token: + description: + - Token is the opaque bearer token. + type: str + status: + description: + - Status is filled in by the server and indicates whether the request can be + authenticated. + type: complex + contains: + authenticated: + description: + - Authenticated indicates that the token was associated with a known user. + type: bool + error: + description: + - Error indicates that the token couldn't be checked + type: str + user: + description: + - User is the UserInfo associated with the provided token. + type: complex + contains: + extra: + description: + - Any additional information provided by the authenticator. + type: complex + contains: str, list[str] + groups: + description: + - The names of groups this user is a part of. + type: list + contains: str + uid: + description: + - A unique value that identifies this user across time. If this user + is deleted and another user by the same name is added, they will have + different UIDs. + type: str + username: + description: + - The name that uniquely identifies this user among all active users. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('token_review', 'V1beta1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v2alpha1_cron_job.py b/library/k8s_v2alpha1_cron_job.py new file mode 100644 index 00000000..9b227f6f --- /dev/null +++ b/library/k8s_v2alpha1_cron_job.py @@ -0,0 +1,2795 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v2alpha1_cron_job +short_description: Kubernetes CronJob +description: +- Manage the lifecycle of a cron_job object. Supports check mode, and attempts to + to be idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_concurrency_policy: + description: + - ConcurrencyPolicy specifies how to treat concurrent executions of a Job. + aliases: + - concurrency_policy + spec_job_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - job__active_deadline_seconds + type: int + spec_job_template_completions: + description: + - Completions specifies the desired number of successfully finished pods the job + should be run with. Setting to nil means that the success of any pod signals + the success of all pods, and allows parallelism to have any positive value. + Setting to 1 means that parallelism is limited to 1 and the success of that + pod signals the success of the job. + aliases: + - job__completions + type: int + spec_job_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - job__containers + type: list + spec_job_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - job__dns_policy + spec_job_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - job__host_ipc + type: bool + spec_job_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - job__host_network + type: bool + spec_job_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - job__host_pid + type: bool + spec_job_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - job__hostname + spec_job_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - job__image_pull_secrets + type: list + spec_job_template_manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` + unset unless you are certain what you are doing. When false or unset, the system + pick labels unique to this job and appends those labels to the pod template. + When true, the user is responsible for picking unique labels and specifying + the selector. Failure to pick a unique label may cause this and other jobs to + not function correctly. However, You may see `manualSelector=true` in jobs that + were created with the old `extensions/v1beta1` API. + aliases: + - job__manual_selector + type: bool + spec_job_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + aliases: + - job__metadata_annotations + type: dict + spec_job_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + aliases: + - job__metadata_labels + type: dict + spec_job_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + aliases: + - job__metadata_name + spec_job_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + aliases: + - job__metadata_namespace + spec_job_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - job__node_name + spec_job_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - job__node_selector + type: dict + spec_job_template_parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should run + at any given time. The actual number of pods running in steady state will be + less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), + i.e. when the work left to do is less than max parallelism. + aliases: + - job__parallelism + type: int + spec_job_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - job__restart_policy + spec_job_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - job__securitycontext_fs_group + type: int + spec_job_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - job__securitycontext_run_as_non_root + type: bool + spec_job_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - job__securitycontext_run_as_user + type: int + spec_job_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - job__securitycontext_se_linux_options_level + spec_job_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - job__securitycontext_se_linux_options_role + spec_job_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - job__securitycontext_se_linux_options_type + spec_job_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - job__securitycontext_se_linux_options_user + spec_job_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - job__securitycontext_supplemental_groups + type: list + spec_job_template_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - job__selector_match_expressions + type: list + spec_job_template_selector_match_labels: + description: + - 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. + aliases: + - job__selector_match_labels + type: dict + spec_job_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - job__service_account + spec_job_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - job__service_account_name + spec_job_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - job__subdomain + spec_job_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - job__termination_grace_period_seconds + type: int + spec_job_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - job__volumes + type: list + spec_schedule: + description: + - Schedule contains the schedule in Cron format, see + aliases: + - schedule + spec_starting_deadline_seconds: + description: + - Optional deadline in seconds for starting the job if it misses scheduled time + for any reason. Missed jobs executions will be counted as failed ones. + aliases: + - starting_deadline_seconds + type: int + spec_suspend: + description: + - Suspend flag tells the controller to suspend subsequent executions, it does + not apply to already started executions. Defaults to false. + aliases: + - suspend + type: bool + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cron_job: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job, including the + schedule. + type: complex + contains: + concurrency_policy: + description: + - ConcurrencyPolicy specifies how to treat concurrent executions of a Job. + type: str + job_template: + description: + - JobTemplate is the object that describes the job that will be created + when executing a CronJob. + type: complex + contains: + metadata: + description: + - Standard object's metadata of the jobs created from this template. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the + job may be active before the system tries to terminate it; value + must be positive integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished + pods the job should be run with. Setting to nil means that the + success of any pod signals the success of all pods, and allows + parallelism to have any positive value. Setting to 1 means that + parallelism is limited to 1 and the success of that pod signals + the success of the job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. + Leave `manualSelector` unset unless you are certain what you are + doing. When false or unset, the system pick labels unique to this + job and appends those labels to the pod template. When true, the + user is responsible for picking unique labels and specifying the + selector. Failure to pick a unique label may cause this and other + jobs to not function correctly. However, You may see `manualSelector=true` + in jobs that were created with the old `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job + should run at any given time. The actual number of pods running + in steady state will be less than this number when ((.spec.completions + - .status.successful) < .spec.parallelism), i.e. when the work + left to do is less than max parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod + count. Normally, the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is + In or NotIn, the values array must be non-empty. If the + operator is Exists or DoesNotExist, the values array must + be empty. This array is replaced during a strategic merge + patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + when executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store + and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere + right now and apiserver is going to ignore it if set in + create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed + to be set in happens-before order across separate operations. + Clients may not set this value. It is represented in RFC3339 + form and is in UTC. Populated by the system. Read-only. + Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only + set when deletionTimestamp is also set. May only be shortened. + Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and + is not directly settable by a client. The resource is + expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this + field. Once set, this value may not be unset or be set + further into the future, although it may be shortened + or the resource may be deleted prior to this time. For + example, a user may request that a pod is deleted in 30 + seconds. The Kubelet will react by sending a graceful + termination signal to the containers in the pod. After + that 30 seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, remove + the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until + an administrator or automated process can determine the + resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the + system when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only + be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not + been provided. If this field is used, the name returned + to the client will be different than the name passed. + This value will also be combined with a unique suffix. + The provided value has the same validation rules as the + Name field, and may be truncated by the length of the + suffix required to make the value unique on the server. + If this field is specified and the generated name exists, + the server will NOT return a 409 - instead, it will either + return 201 Created or 500 with Reason ServerTimeout indicating + a unique name could not be found in the time allotted, + and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if + Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when + creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all + objects are required to be scoped to a namespace - the + value of this field for those objects will be empty. Must + be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage + collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be + more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of + this object that can be used by clients to determine when + objects have changed. May be used for optimistic concurrency, + change detection, and the watch operation on a resource + or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of + resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful + creation of a resource and is not allowed to change on + PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on + the node relative to StartTime before the system will + actively try to mark it failed and kill associated containers. + Value must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least + one container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD\ + \ is used if this is not provided. Variable references\ + \ $(VAR_NAME) are expanded using the container's environment.\ + \ If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME)\ + \ syntax can be escaped with a double $$, ie: $$(VAR_NAME).\ + \ Escaped references will never be expanded, regardless\ + \ of whether the variable exists or not. Cannot be\ + \ updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The\ + \ docker image's ENTRYPOINT is used if this is not\ + \ provided. Variable references $(VAR_NAME) are expanded\ + \ using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string\ + \ will be unchanged. The $(VAR_NAME) syntax can be\ + \ escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of\ + \ whether the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded + using the previous defined environment variables + in the container and any service environment variables. + If a variable cannot be resolved, the reference + in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only + resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. + Must be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or + IfNotPresent otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in + response to container lifecycle events. Cannot be + updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container + is terminated and restarted according to its restart + policy. Other management of the container blocks + until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be + specified. Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly + call out to that shell. Exit status of + 0 is treated as live/healthy and non-zero + is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the + pod IP. You probably want to set "Host" + in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a + TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container + is terminated. The container is terminated after + the handler completes. The reason for termination + is passed to the handler. Regardless of the outcome + of the handler, the container is eventually terminated. + Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be + specified. Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly + call out to that shell. Exit status of + 0 is treated as live/healthy and non-zero + is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the + pod IP. You probably want to set "Host" + in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a + TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will + be restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to + be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to + be considered successful after having failed. + Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each + container in a pod must have a unique name (DNS_LABEL). + Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing + a port here gives the system additional information + about the network connections a container uses, but + is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. + Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and + unique within the pod. Each named port in a pod + must have a unique name. Name for the port that + can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults + to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe + fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to + be considered failed after having succeeded. Defaults + to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to + be considered successful after having failed. + Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot + be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute + resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute + resources required. If Requests is omitted for + a container, it defaults to Limits if that is + explicitly specified, otherwise to an implementation-defined + value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in + privileged containers are essentially equivalent + to root on the host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID + 0 (root) and fail to start the container if it + does. If unset or false, no such validation will + be performed. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container + process. Defaults to user specified in image metadata + if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May + also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies + to the container. + type: str + role: + description: + - Role is a SELinux role label that applies + to the container. + type: str + type: + description: + - Type is a SELinux type label that applies + to the container. + type: str + user: + description: + - User is a SELinux user label that applies + to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for + stdin in the container runtime. If this is not set, + reads from stdin in the container will always result + in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin + channel after it has been opened by a single attach. + When stdin is true the stdin stream will remain open + across multiple attach sessions. If stdinOnce is set + to true, stdin is opened on container start, is empty + until the first client attaches to stdin, and then + remains open and accepts data until the client disconnects, + at which time stdin is closed and remains closed until + the container is restarted. If this flag is false, + a container processes that reads from stdin will never + receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot\ + \ be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume + should be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise + (false or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the + container runtime's default will be used, which might + be configured in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that + will be used must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the + pod's hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to + secrets in the same namespace to use for pulling any of + the images used by this PodSpec. If specified, these secrets + will be passed to individual puller implementations for + them to use. For example, in the case of docker, only + DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules + this pod onto that node, assuming that it fits resource + requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the + pod to fit on a node. Selector which must match a node's + labels for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One + of Always, OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and + common container settings. Optional: Defaults to empty. + See type description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1. The owning GID will be the\ + \ FSGroup 2. The setgid bit is set (new files created\ + \ in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet\ + \ will not modify the ownership and permissions of\ + \ any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in SecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for + that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run + in each container, in addition to the container's + primary GID. If unspecified, no groups will be added + to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to + use to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be + "...svc.". + If not specified, the pod will not have a domainname at + all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate + gracefully. May be decreased in delete request. Value + must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default + grace period will be used instead. The grace period is + the duration in seconds after the processes running in + the pod are sent a termination signal and the time when + the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for + your process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource + that is attached to a kubelet's host machine and then + exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to + mount. Tip: Ensure that the filesystem type is + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to + mount. If omitted, the default is to mount by + volume name. Examples: For volume /dev/sda1, you + specify the partition as "1". Similarly, the volume + partition for /dev/sda is "0" (or you can leave + the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS + (Amazon EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the + host and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Ex. + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on + the host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage + Account Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that + shares a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than + the full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring + for User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default + is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by + default. Must be a value between 0 and 0777. Defaults + to 0644. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data + field of the referenced ConfigMap will be projected + into the volume as a file whose name is the key + and content is the value. If specified, the listed + keys will be projected into the specified paths, + and unlisted keys will not be present. If a key + is specified which is not present in the ConfigMap, + the volume setup will error. Paths must be relative + and may not contain the '..' path or start with + '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If not + specified, the volume defaultMode will be + used. This might be in conflict with other + options that affect the file mode, like fsGroup, + and the result can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key + to. May not be an absolute path. May not contain + the path element '..'. May not start with + the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod + that should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by + default. Must be a value between 0 and 0777. Defaults + to 0644. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only + annotations, labels, name and namespace are + supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If not + specified, the volume defaultMode will be + used. This might be in conflict with other + options that affect the file mode, like fsGroup, + and the result can be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name\ + \ of the file to be created. Must not be absolute\ + \ or contain the '..' path. Must be utf-8\ + \ encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only + resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's + default medium. Must be an empty string (default) + or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the + pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Ex. + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that + is provisioned/attached using an exec based plugin. + This is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this + volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Ex. + "ext4", "xfs", "ntfs". The default filesystem + depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret + object containing sensitive information to pass + to the plugin scripts. This may be empty if no + secret object is specified. If the secret object + contains more than one secret, all secrets are + passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a + kubelet's host machine. This depends on the Flocker + control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name + on the dataset for Flocker should be considered + as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier + of a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to + mount. Tip: Ensure that the filesystem type is + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to + mount. If omitted, the default is to mount by + volume name. Examples: For volume /dev/sda1, you + specify the partition as "1". Similarly, the volume + partition for /dev/sda is "0" (or you can leave + the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to + identify the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular + revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start + with '..'. If '.' is supplied, the volume directory + will be the git repository. Otherwise, if specified, + the volume will contain the git repository in + the subdirectory with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host + that shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details + Glusterfs topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume + to be mounted with read-only permissions. Defaults + to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory + on the host machine that is directly exposed to the + container. This is generally used for system agents + or other privileged things that are allowed to see + the host machine. Most containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the + pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to + mount. Tip: Ensure that the filesystem type is + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI\ + \ interface name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP + or ip_addr:port if the port is other than default + (typically TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by + default. Must be a value between 0 and 0777. Defaults + to 0644. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only + annotations, labels, name and namespace are + supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If not + specified, the volume defaultMode will be + used. This might be in conflict with other + options that affect the file mode, like fsGroup, + and the result can be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name\ + \ of the file to be created. Must not be absolute\ + \ or contain the '..' path. Must be utf-8\ + \ encoded. The first item of the relative\ + \ path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only + resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within + the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares + a pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be + mounted with read-only permissions. Defaults to + false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS + server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim + in the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. + Default false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController + persistent disk attached and mounted on kubelets host + machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Ex. + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent + disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that + shares a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to + be mounted with read-only permissions. Defaults + to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte + Registry services specified as a string as host:port + pair (multiple entries are separated with commas) + which acts as the central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already + created Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to + mount. Tip: Ensure that the filesystem type is + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret + for RBDUser. If provided overrides keyring. Default + is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this + volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by + default. Must be a value between 0 and 0777. Defaults + to 0644. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data + field of the referenced Secret will be projected + into the volume as a file whose name is the key + and content is the value. If specified, the listed + keys will be projected into the specified paths, + and unlisted keys will not be present. If a key + is specified which is not present in the Secret, + the volume setup will error. Paths must be relative + and may not contain the '..' path or start with + '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If not + specified, the volume defaultMode will be + used. This might be in conflict with other + options that affect the file mode, like fsGroup, + and the result can be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key + to. May not be an absolute path. May not contain + the path element '..'. May not start with + the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached + and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. Ex. + "ext4", "xfs", "ntfs". Implicitly inferred to + be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + schedule: + description: + - Schedule contains the schedule in Cron format, see + type: str + starting_deadline_seconds: + description: + - Optional deadline in seconds for starting the job if it misses scheduled + time for any reason. Missed jobs executions will be counted as failed + ones. + type: int + suspend: + description: + - Suspend flag tells the controller to suspend subsequent executions, it + does not apply to already started executions. Defaults to false. + type: bool + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active holds pointers to currently running jobs. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the object + reference is to a container within a pod, this would take on a value + like: "spec.containers{name}" (where "name" refers to the name of + the container that triggered the event) or if no container name is + specified "spec.containers[2]" (container with index 2 in this pod). + This syntax is chosen only to have some well-defined way of referencing + a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + last_schedule_time: + description: + - LastScheduleTime keeps information of when was the last time the job was + successfully scheduled. + type: complex + contains: {} +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cron_job', 'V2alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v2alpha1_cron_job_list.py b/library/k8s_v2alpha1_cron_job_list.py new file mode 100644 index 00000000..a8fd6977 --- /dev/null +++ b/library/k8s_v2alpha1_cron_job_list.py @@ -0,0 +1,2630 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v2alpha1_cron_job_list +short_description: Kubernetes CronJobList +description: +- Retrieve a list of cron_jobs. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +cron_job_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of CronJob. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job, including + the schedule. + type: complex + contains: + concurrency_policy: + description: + - ConcurrencyPolicy specifies how to treat concurrent executions of + a Job. + type: str + job_template: + description: + - JobTemplate is the object that describes the job that will be created + when executing a CronJob. + type: complex + contains: + metadata: + description: + - Standard object's metadata of the jobs created from this template. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that + the job may be active before the system tries to terminate + it; value must be positive integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished + pods the job should be run with. Setting to nil means that + the success of any pod signals the success of all pods, and + allows parallelism to have any positive value. Setting to + 1 means that parallelism is limited to 1 and the success of + that pod signals the success of the job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. + Leave `manualSelector` unset unless you are certain what you + are doing. When false or unset, the system pick labels unique + to this job and appends those labels to the pod template. + When true, the user is responsible for picking unique labels + and specifying the selector. Failure to pick a unique label + may cause this and other jobs to not function correctly. However, + You may see `manualSelector=true` in jobs that were created + with the old `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the + job should run at any given time. The actual number of pods + running in steady state will be less than this number when + ((.spec.completions - .status.successful) < .spec.parallelism), + i.e. when the work left to do is less than max parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the + pod count. Normally, the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. + The requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set + of values. Valid operators ard In, NotIn, Exists and + DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator + is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during + a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be + created when executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored + with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. + This is used to distinguish resources with same name + and namespace in different clusters. This field is + not set anywhere right now and apiserver is going + to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the + server time when this object was created. It is not + guaranteed to be set in happens-before order across + separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated + by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. + Only set when deletionTimestamp is also set. May only + be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by + the server when a graceful deletion is requested by + the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by + name) after the time in this field. Once set, this + value may not be unset or be set further into the + future, although it may be shortened or the resource + may be deleted prior to this time. For example, a + user may request that a pod is deleted in 30 seconds. + The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 + seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network + partitions, this object may still exist after this + timestamp, until an administrator or automated process + can determine the resource is fully terminated. If + not set, graceful deletion of the object has not been + requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the + registry. Each entry is an identifier for the responsible + component that will remove the entry from the list. + If the deletionTimestamp of the object is non-nil, + entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has + not been provided. If this field is used, the name + returned to the client will be different than the + name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. If this field is specified and the + generated name exists, the server will NOT return + a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique + name could not be found in the time allotted, and + the client should retry (optionally after the time + indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to + organize and categorize (scope and select) objects. + May match selectors of replication controllers and + services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required + when creating resources, although some resources may + allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for + creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must + be unique. An empty namespace is equivalent to the + "default" namespace, but "default" is the canonical + representation. Not all objects are required to be + scoped to a namespace - the value of this field for + those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be + garbage collected. If this object is managed by a + controller, then an entry in this list will point + to this controller, with the controller field set + to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing + controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version + of this object that can be used by clients to determine + when objects have changed. May be used for optimistic + concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back + to the server. They may only be valid for a particular + resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this + object. It is typically generated by the server on + successful creation of a resource and is not allowed + to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active + on the node relative to StartTime before the system + will actively try to mark it failed and kill associated + containers. Value must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers + cannot currently be added or removed. There must be + at least one container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's\ + \ CMD is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot\ + \ be resolved, the reference in the input string\ + \ will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME).\ + \ Escaped references will never be expanded, regardless\ + \ of whether the variable exists or not. Cannot\ + \ be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell.\ + \ The docker image's ENTRYPOINT is used if this\ + \ is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment.\ + \ If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME)\ + \ syntax can be escaped with a double $$, ie:\ + \ $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable\ + \ exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be + a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded + using the previous defined environment variables + in the container and any service environment + variables. If a variable cannot be resolved, + the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped + with a double $$, ie: $$(VAR_NAME). Escaped + references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: str + value_from: + description: + - Source for the environment variable's value. + Cannot be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports + metadata.name, metadata.namespace, metadata.labels, + metadata.annotations, spec.nodeName, spec.serviceAccountName, + status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath + is written in terms of, defaults to + "v1". + type: str + field_path: + description: + - Path of the field to select in the + specified API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the + exposed resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's + namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. + Must be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, + or IfNotPresent otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take + in response to container lifecycle events. Cannot + be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container + is terminated and restarted according to its + restart policy. Other management of the container + blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should + be specified. Exec specifies the action + to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working + directory for the command is root + ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to + perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults + to the pod IP. You probably want to + set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access + on the container. Number must be in + the range 1 to 65535. Name must be + an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the + host. Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access + on the container. Number must be in + the range 1 to 65535. Name must be + an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container + is terminated. The container is terminated + after the handler completes. The reason for + termination is passed to the handler. Regardless + of the outcome of the handler, the container + is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should + be specified. Exec specifies the action + to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working + directory for the command is root + ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to + perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults + to the pod IP. You probably want to + set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access + on the container. Number must be in + the range 1 to 65535. Name must be + an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the + host. Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access + on the container. Number must be in + the range 1 to 65535. Name must be + an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container + will be restarted if the probe fails. Cannot be + updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be + specified. Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly + call out to that shell. Exit status of + 0 is treated as live/healthy and non-zero + is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe + to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the + pod IP. You probably want to set "Host" + in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has + started before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe + to be considered successful after having failed. + Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a + TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is + 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. + Each container in a pod must have a unique name + (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing + a port here gives the system additional information + about the network connections a container uses, + but is primarily informational. Not specifying + a port here DOES NOT prevent that port from being + exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible + from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < + 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < + 65536. If HostNetwork is specified, this must + match ContainerPort. Most containers do not + need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME + and unique within the pod. Each named port + in a pod must have a unique name. Name for + the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults + to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. + Container will be removed from service endpoints + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be + specified. Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, + it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly + call out to that shell. Exit status of + 0 is treated as live/healthy and non-zero + is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe + to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the + pod IP. You probably want to set "Host" + in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. + HTTP allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has + started before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe + to be considered successful after having failed. + Defaults to 1. Must be 1 for liveness. Minimum + value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a + TCP port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on + the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is + 1. + type: int + resources: + description: + - Compute Resources required by this container. + Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute + resources allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute + resources required. If Requests is omitted + for a container, it defaults to Limits if + that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running + containers. Defaults to the default set of + capabilities granted by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes + in privileged containers are essentially equivalent + to root on the host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root + filesystem. Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a + non-root user. If true, the Kubelet will validate + the image at runtime to ensure that it does + not run as UID 0 (root) and fail to start + the container if it does. If unset or false, + no such validation will be performed. May + also be set in PodSecurityContext. If set + in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container + process. Defaults to user specified in image + metadata if unspecified. May also be set in + PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will + allocate a random SELinux context for each + container. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies + to the container. + type: str + role: + description: + - Role is a SELinux role label that applies + to the container. + type: str + type: + description: + - Type is a SELinux type label that applies + to the container. + type: str + user: + description: + - User is a SELinux user label that applies + to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer + for stdin in the container runtime. If this is + not set, reads from stdin in the container will + always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the + stdin channel after it has been opened by a single + attach. When stdin is true the stdin stream will + remain open across multiple attach sessions. If + stdinOnce is set to true, stdin is opened on container + start, is empty until the first client attaches + to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin + is closed and remains closed until the container + is restarted. If this flag is false, a container + processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the\ + \ container's termination message will be written\ + \ is mounted into the container's filesystem.\ + \ Message written is intended to be brief final\ + \ status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for + itself, also requires 'stdin' to be true. Default + is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume + should be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise + (false or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, + the container runtime's default will be used, + which might be configured in the container image. + Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One + of 'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to\ + \ false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports + that will be used must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to\ + \ false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, + the pod's hostname will be set to a system-defined + value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling + any of the images used by this PodSpec. If specified, + these secrets will be passed to individual puller + implementations for them to use. For example, in the + case of docker, only DockerConfig type secrets are + honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a + specific node. If it is non-empty, the scheduler simply + schedules this pod onto that node, assuming that it + fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match + a node's labels for the pod to be scheduled on that + node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. + One of Always, OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes + and common container settings. Optional: Defaults + to empty. See type description for default values + of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1. The owning\ + \ GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are\ + \ OR'd with rw-rw---- If unset, the Kubelet will\ + \ not modify the ownership and permissions of\ + \ any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID + 0 (root) and fail to start the container if it + does. If unset or false, no such validation will + be performed. May also be set in SecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container + process. Defaults to user specified in image metadata + if unspecified. May also be set in SecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May + also be set in SecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies + to the container. + type: str + role: + description: + - Role is a SELinux role label that applies + to the container. + type: str + type: + description: + - Type is a SELinux type label that applies + to the container. + type: str + user: + description: + - User is a SELinux user label that applies + to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process + run in each container, in addition to the container's + primary GID. If unspecified, no groups will be + added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for + ServiceAccountName. Deprecated: Use serviceAccountName + instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount + to use to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will + be "...svc.". If not specified, the pod will not have + a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate + gracefully. May be decreased in delete request. Value + must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default + grace period will be used instead. The grace period + is the duration in seconds after the processes running + in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill + signal. Set this value longer than the expected cleanup + time for your process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers + belonging to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource + that is attached to a kubelet's host machine and + then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want + to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want + to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, + the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly + property in VolumeMounts to "true". If omitted, + the default is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource + in AWS (Amazon EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount + on the host and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read + Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount + on the host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage + Account Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host + that shares a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph + monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather + than the full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring + for User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default + is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files + by default. Must be a value between 0 and + 0777. Defaults to 0644. Directories within + the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the + Data field of the referenced ConfigMap will + be projected into the volume as a file whose + name is the key and content is the value. + If specified, the listed keys will be projected + into the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the ConfigMap, the + volume setup will error. Paths must be relative + and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If + not specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the + key to. May not be an absolute path. May + not contain the path element '..'. May + not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the + pod that should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files + by default. Must be a value between 0 and + 0777. Defaults to 0644. Directories within + the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: + only annotations, labels, name and namespace + are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath + is written in terms of, defaults to + "v1". + type: str + field_path: + description: + - Path of the field to select in the + specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If + not specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name\ + \ of the file to be created. Must not\ + \ be absolute or contain the '..' path.\ + \ Must be utf-8 encoded. The first item\ + \ of the relative path must not start\ + \ with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the + exposed resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that + shares a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this + directory. The default is "" which means to + use the node's default medium. Must be an + empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is + attached to a kubelet's host machine and then + exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource + that is provisioned/attached using an exec based + plugin. This is an alpha feature and may change + in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for + this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". The default filesystem + depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret + object containing sensitive information to + pass to the plugin scripts. This may be empty + if no secret object is specified. If the secret + object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to + a kubelet's host machine. This depends on the + Flocker control service being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> + name on the dataset for Flocker should be + considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier + of a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource + that is attached to a kubelet's host machine and + then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want + to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want + to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, + the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used + to identify the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular + revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or + start with '..'. If '.' is supplied, the volume + directory will be the git repository. Otherwise, + if specified, the volume will contain the + git repository in the subdirectory with the + given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the + host that shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details + Glusterfs topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume + to be mounted with read-only permissions. + Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory + on the host machine that is directly exposed to + the container. This is generally used for system + agents or other privileged things that are allowed + to see the host machine. Most containers will + NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is + attached to a kubelet's host machine and then + exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want + to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI\ + \ interface name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either + an IP or ip_addr:port if the port is other + than default (typically TCP ports 860 and + 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that + should populate this volume Deprecated: Use downwardAPI + instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files + by default. Must be a value between 0 and + 0777. Defaults to 0644. Directories within + the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: + only annotations, labels, name and namespace + are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath + is written in terms of, defaults to + "v1". + type: str + field_path: + description: + - Path of the field to select in the + specified API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If + not specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name\ + \ of the file to be created. Must not\ + \ be absolute or contain the '..' path.\ + \ Must be utf-8 encoded. The first item\ + \ of the relative path must not start\ + \ with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, + optional for env vars' + type: str + divisor: + description: + - Specifies the output format of the + exposed resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique + within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares + a pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to + be mounted with read-only permissions. Defaults + to false. + type: bool + server: + description: + - Server is the hostname or IP address of the + NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a + reference to a PersistentVolumeClaim in the same + namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim + in the same namespace as the pod using this + volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. + Default false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController + persistent disk attached and mounted on kubelets + host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent + disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host + that shares a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no + group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume + to be mounted with read-only permissions. + Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte + Registry services specified as a string as + host:port pair (multiple entries are separated + with commas) which acts as the central registry + for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already + created Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the + host that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want + to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret + for RBDUser. If provided overrides keyring. + Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate + this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files + by default. Must be a value between 0 and + 0777. Defaults to 0644. Directories within + the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the + Data field of the referenced Secret will be + projected into the volume as a file whose + name is the key and content is the value. + If specified, the listed keys will be projected + into the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the Secret, the volume + setup will error. Paths must be relative and + may not contain the '..' path or start with + '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, + must be a value between 0 and 0777. If + not specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the + key to. May not be an absolute path. May + not contain the path element '..'. May + not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace + to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached + and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem + type supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + schedule: + description: + - Schedule contains the schedule in Cron format, see + type: str + starting_deadline_seconds: + description: + - Optional deadline in seconds for starting the job if it misses scheduled + time for any reason. Missed jobs executions will be counted as failed + ones. + type: int + suspend: + description: + - Suspend flag tells the controller to suspend subsequent executions, + it does not apply to already started executions. Defaults to false. + type: bool + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active holds pointers to currently running jobs. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + field_path: + description: + - 'If referring to a piece of an object instead of an entire object, + this string should contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For example, if the + object reference is to a container within a pod, this would take + on a value like: "spec.containers{name}" (where "name" refers + to the name of the container that triggered the event) or if no + container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some + well-defined way of referencing a part of an object.' + type: str + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + namespace: + description: + - Namespace of the referent. + type: str + resource_version: + description: + - Specific resourceVersion to which this reference is made, if any. + type: str + uid: + description: + - UID of the referent. + type: str + last_schedule_time: + description: + - LastScheduleTime keeps information of when was the last time the job + was successfully scheduled. + type: complex + contains: {} + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('cron_job_list', 'V2alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v2alpha1_job.py b/library/k8s_v2alpha1_job.py new file mode 100644 index 00000000..0231689b --- /dev/null +++ b/library/k8s_v2alpha1_job.py @@ -0,0 +1,2486 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v2alpha1_job +short_description: Kubernetes Job +description: +- Manage the lifecycle of a job object. Supports check mode, and attempts to to be + idempotent. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + spec_active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may be active + before the system tries to terminate it; value must be positive integer + aliases: + - active_deadline_seconds + type: int + spec_completions: + description: + - Completions specifies the desired number of successfully finished pods the job + should be run with. Setting to nil means that the success of any pod signals + the success of all pods, and allows parallelism to have any positive value. + Setting to 1 means that parallelism is limited to 1 and the success of that + pod signals the success of the job. + aliases: + - completions + type: int + spec_manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` + unset unless you are certain what you are doing. When false or unset, the system + pick labels unique to this job and appends those labels to the pod template. + When true, the user is responsible for picking unique labels and specifying + the selector. Failure to pick a unique label may cause this and other jobs to + not function correctly. However, You may see `manualSelector=true` in jobs that + were created with the old `extensions/v1beta1` API. + aliases: + - manual_selector + type: bool + spec_parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should run + at any given time. The actual number of pods running in steady state will be + less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), + i.e. when the work left to do is less than max parallelism. + aliases: + - parallelism + type: int + spec_selector_match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + aliases: + - selector_match_expressions + type: list + spec_selector_match_labels: + description: + - 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. + aliases: + - selector_match_labels + type: dict + spec_template_active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node relative to StartTime + before the system will actively try to mark it failed and kill associated containers. + Value must be a positive integer. + aliases: + - active_deadline_seconds + type: int + spec_template_containers: + description: + - List of containers belonging to the pod. Containers cannot currently be added + or removed. There must be at least one container in a Pod. Cannot be updated. + aliases: + - containers + type: list + spec_template_dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' or 'Default'. + Defaults to "ClusterFirst". + aliases: + - dns_policy + spec_template_host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + aliases: + - host_ipc + type: bool + spec_template_host_network: + description: + - Host networking requested for this pod. Use the host's network namespace. If + this option is set, the ports that will be used must be specified. Default to + false. + aliases: + - host_network + type: bool + spec_template_host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + aliases: + - host_pid + type: bool + spec_template_hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's hostname will + be set to a system-defined value. + aliases: + - hostname + spec_template_image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets in the same namespace + to use for pulling any of the images used by this PodSpec. If specified, these + secrets will be passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type secrets are honored. + aliases: + - image_pull_secrets + type: list + spec_template_metadata_annotations: + description: + - Annotations is an unstructured key value map stored with a resource that may + be set by external tools to store and retrieve arbitrary metadata. They are + not queryable and should be preserved when modifying objects. + type: dict + spec_template_metadata_labels: + description: + - Map of string keys and values that can be used to organize and categorize (scope + and select) objects. May match selectors of replication controllers and services. + type: dict + spec_template_metadata_name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation idempotence and + configuration definition. Cannot be updated. + required: true + spec_template_metadata_namespace: + description: + - Namespace defines the space within each name must be unique. An empty namespace + is equivalent to the "default" namespace, but "default" is the canonical representation. + Not all objects are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. + spec_template_node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, + the scheduler simply schedules this pod onto that node, assuming that it fits + resource requirements. + aliases: + - node_name + spec_template_node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit on a node. + Selector which must match a node's labels for the pod to be scheduled on that + node. + aliases: + - node_selector + type: dict + spec_template_restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, OnFailure, + Never. Default to Always. + aliases: + - restart_policy + spec_template_security_context_fs_group: + description: + - "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\ + \ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\ + \ is set (new files created in the volume will be owned by FSGroup) 3. The permission\ + \ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\ + \ and permissions of any volume." + aliases: + - security_context_fs_group + type: int + spec_template_security_context_run_as_non_root: + description: + - Indicates that the container must run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure that it does not run as UID 0 (root) + and fail to start the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext takes precedence. + aliases: + - security_context_run_as_non_root + type: bool + spec_template_security_context_run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults to user specified + in image metadata if unspecified. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + aliases: + - security_context_run_as_user + type: int + spec_template_security_context_se_linux_options_level: + description: + - Level is SELinux level label that applies to the container. + aliases: + - security_context_se_linux_options_level + spec_template_security_context_se_linux_options_role: + description: + - Role is a SELinux role label that applies to the container. + aliases: + - security_context_se_linux_options_role + spec_template_security_context_se_linux_options_type: + description: + - Type is a SELinux type label that applies to the container. + aliases: + - security_context_se_linux_options_type + spec_template_security_context_se_linux_options_user: + description: + - User is a SELinux user label that applies to the container. + aliases: + - security_context_se_linux_options_user + spec_template_security_context_supplemental_groups: + description: + - A list of groups applied to the first process run in each container, in addition + to the container's primary GID. If unspecified, no groups will be added to any + container. + aliases: + - security_context_supplemental_groups + type: list + spec_template_service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: + Use serviceAccountName instead.' + aliases: + - service_account + spec_template_service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to run this pod. + aliases: + - service_account_name + spec_template_subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a + domainname at all. + aliases: + - subdomain + spec_template_termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. May be decreased + in delete request. Value must be non-negative integer. The value zero indicates + delete immediately. If this value is nil, the default grace period will be used + instead. The grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the processes are + forcibly halted with a kill signal. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + aliases: + - termination_grace_period_seconds + type: int + spec_template_volumes: + description: + - List of volumes that can be mounted by containers belonging to the pod. + aliases: + - volumes + type: list + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource that + may be set by external tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used to distinguish + resources with same name and namespace in different clusters. This field + is not set anywhere right now and apiserver is going to ignore it if set + in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when this + object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. Populated by the system. Read-only. Null + for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate before + it will be removed from the system. Only set when deletionTimestamp is + also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource will + be deleted. This field is set by the server when a graceful deletion is + requested by the user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once set, this value + may not be unset or be set further into the future, although it may be + shortened or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers in the + pod. After that 30 seconds, the Kubelet will send a hard termination signal + (SIGKILL) to the container and after cleanup, remove the pod from the + API. In the presence of network partitions, this object may still exist + after this timestamp, until an administrator or automated process can + determine the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system when a graceful + deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each entry + is an identifier for the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object is non-nil, entries + in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate a + unique name ONLY IF the Name field has not been provided. If this field + is used, the name returned to the client will be different than the name + passed. This value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and may be truncated + by the length of the suffix required to make the value unique on the server. + If this field is specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created or 500 with + Reason ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the time + indicated in the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired state. + Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating resources, + although some resources may allow a client to request the generation of + an appropriate name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" is the + canonical representation. Not all objects are required to be scoped to + a namespace - the value of this field for those objects will be empty. + Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list have + been deleted, this object will be garbage collected. If this object is + managed by a controller, then an entry in this list will point to this + controller, with the controller field set to true. There cannot be more + than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object that + can be used by clients to determine when objects have changed. May be + used for optimistic concurrency, change detection, and the watch operation + on a resource or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may only be valid + for a particular resource or set of resources. Populated by the system. + Read-only. Value must be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is not + allowed to change on PUT operations. Populated by the system. Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job may + be active before the system tries to terminate it; value must be positive + integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished pods + the job should be run with. Setting to nil means that the success of any + pod signals the success of all pods, and allows parallelism to have any + positive value. Setting to 1 means that parallelism is limited to 1 and + the success of that pod signals the success of the job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. Leave + `manualSelector` unset unless you are certain what you are doing. When + false or unset, the system pick labels unique to this job and appends + those labels to the pod template. When true, the user is responsible for + picking unique labels and specifying the selector. Failure to pick a unique + label may cause this and other jobs to not function correctly. However, + You may see `manualSelector=true` in jobs that were created with the old + `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady state + will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. Normally, + the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The requirements + are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. Valid + operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In or + NotIn, the values array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must be empty. This array + is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created when + executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when + modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set in + happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted (no longer + visible from resource lists, and not reachable by name) after + the time in this field. Once set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. The Kubelet + will react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + Populated by the system when a graceful deletion is requested. + Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that + will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If + this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a + unique suffix. The provided value has the same validation rules + as the Name field, and may be truncated by the length of the suffix + required to make the value unique on the server. If this field + is specified and the generated name exists, the server will NOT + return a 409 - instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name could not be + found in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied only + if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and + categorize (scope and select) objects. May match selectors of + replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. + Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An + empty namespace is equivalent to the "default" namespace, but + "default" is the canonical representation. Not all objects are + required to be scoped to a namespace - the value of this field + for those objects will be empty. Must be a DNS_LABEL. Cannot be + updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the + list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field + set to true. There cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and + the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. Populated by the system. Read-only. Value must + be treated as opaque by clients and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It + is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. Populated + by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the node + relative to StartTime before the system will actively try to mark + it failed and kill associated containers. Value must be a positive + integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot currently + be added or removed. There must be at least one container in a + Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is used\ + \ if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a variable\ + \ cannot be resolved, the reference in the input string will\ + \ be unchanged. The $(VAR_NAME) syntax can be escaped with\ + \ a double $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists or\ + \ not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided. Variable\ + \ references $(VAR_NAME) are expanded using the container's\ + \ environment. If a variable cannot be resolved, the reference\ + \ in the input string will be unchanged. The $(VAR_NAME) syntax\ + \ can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. Cannot + be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using the + previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be + unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will + never be expanded, regardless of whether the variable + exists or not. Defaults to "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot be + used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must be + a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. Defaults + to Always if :latest tag is specified, or IfNotPresent otherwise. + Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container is created. + If the handler fails, the container is terminated and + restarted according to its restart policy. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is terminated. + The container is terminated after the handler completes. + The reason for termination is passed to the handler. Regardless + of the outcome of the handler, the container is eventually + terminated. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be restarted + if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a port + here gives the system additional information about the network + connections a container uses, but is primarily informational. + Not specifying a port here DOES NOT prevent that port from + being exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible from + the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. This + must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, this + must be a valid port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. Most containers + do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have a unique + name. Name for the port that can be referred to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container will + be removed from service endpoints if the probe fails. Cannot + be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside the + container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so + traditional shell instructions ('|', etc) won't work. + To use a shell, you need to explicitly call out to + that shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started before + liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default to + 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be considered + successful after having failed. Defaults to 1. Must be + 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. TCP + hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. Defaults + to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to + an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted by + the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the host. + Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + PodSecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from stdin + in the container will always result in EOF. Default is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin is + true the stdin stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is opened on + container start, is empty until the first client attaches + to stdin, and then remains open and accepts data until the + client disconnects, at which time stdin is closed and remains + closed until the container is restarted. If this flag is false, + a container processes that reads from stdin will never receive + an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into the\ + \ container's filesystem. Message written is intended to be\ + \ brief final status, such as an assertion failure message.\ + \ Defaults to /dev/termination-log. Cannot be updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, also + requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. Cannot + be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should be + mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's volume + should be mounted. Defaults to "" (volume's root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images used + by this PodSpec. If specified, these secrets will be passed to + individual puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific node. + If it is non-empty, the scheduler simply schedules this pod onto + that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod to fit + on a node. Selector which must match a node's labels for the pod + to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type description + for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod: 1.\ + \ The owning GID will be the FSGroup 2. The setgid bit is\ + \ set (new files created in the volume will be owned by FSGroup)\ + \ 3. The permission bits are OR'd with rw-rw---- If unset,\ + \ the Kubelet will not modify the ownership and permissions\ + \ of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime to + ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. Defaults + to user specified in image metadata if unspecified. May also + be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If unspecified, + the container runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. If + unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use to + run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will + not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. The + grace period is the duration in seconds after the processes running + in the pod are sent a termination signal and the time when the + processes are forcibly halted with a kill signal. Set this value + longer than the expected cleanup time for your process. Defaults + to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging to + the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed to + the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default is + "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the host + and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the full + Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for User, + default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted on + kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate this + volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into the + volume as a file whose name is the key and content is + the value. If specified, the listed keys will be projected + into the specified paths, and unlisted keys will not be + present. If a key is specified which is not present in + the ConfigMap, the volume setup will error. Paths must + be relative and may not contain the '..' path or start + with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that should + populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - "Required: Path is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares a pod's + lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may + change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is specified. + If the secret object contains more than one secret, all + secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on the + dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of a Flocker + dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. If + omitted, the default is to mount by volume name. Examples: + For volume /dev/sda1, you specify the partition as "1". + Similarly, the volume partition for /dev/sda is "0" (or + you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will be + the git repository. Otherwise, if specified, the volume + will contain the git repository in the subdirectory with + the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that shares + a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be mounted + with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on the + host machine that is directly exposed to the container. This + is generally used for system agents or other privileged things + that are allowed to see the host machine. Most containers + will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached to + a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or ip_addr:port + if the port is other than default (typically TCP ports + 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should populate + this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified API + version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + name: + description: + - "Required: Name is the relative path name of the file\ + \ to be created. Must not be absolute or contain the\ + \ '..' path. Must be utf-8 encoded. The first item\ + \ of the relative path must not start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, requests.cpu + and requests.memory) are currently supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed resources, + defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a pod's + lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference to + a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in the + same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be mounted + with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the central + registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host that + shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported by the + host operating system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default is + /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for RBDUser. + If provided overrides keyring. Default is nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this setting. + This might be in conflict with other options that affect + the file mode, like fsGroup, and the result can be other + mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the volume + as a file whose name is the key and content is the value. + If specified, the listed keys will be projected into the + specified paths, and unlisted keys will not be present. + If a key is specified which is not present in the Secret, + the volume setup will error. Paths must be relative and + may not contain the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must be + a value between 0 and 0777. If not specified, the + volume defaultMode will be used. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' + type: int + path: + description: + - The relative path of the file to map the key to. May + not be an absolute path. May not contain the path + element '..'. May not start with the string '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type supported + by the host operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not guaranteed + to be set in happens-before order across separate operations. It is represented + in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job Manager. + It is not guaranteed to be set in happens-before order across separate + operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job', 'V2alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/library/k8s_v2alpha1_job_list.py b/library/k8s_v2alpha1_job_list.py new file mode 100644 index 00000000..2380be78 --- /dev/null +++ b/library/k8s_v2alpha1_job_list.py @@ -0,0 +1,2306 @@ +#!/usr/bin/env python + +from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException + +DOCUMENTATION = ''' +module: k8s_v2alpha1_job_list +short_description: Kubernetes JobList +description: +- Retrieve a list of jobs. List operations provide a snapshot read of the underlying + objects, returning a resource_version representing a consistent version of the listed + objects. +version_added: 2.3.0 +author: OpenShift (@openshift) +options: + api_key: + description: + - Token used to connect to the API. + cert_file: + description: + - Path to a certificate used to authenticate with the API. + type: path + context: + description: + - The name of a context found in the Kubernetes config file. + debug: + description: + - Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log + default: false + type: bool + host: + description: + - Provide a URL for acessing the Kubernetes API. + key_file: + description: + - Path to a key file used to authenticate with the API. + type: path + kubeconfig: + description: + - Path to an existing Kubernetes config file. If not provided, and no other connection + options are provided, the openshift client will attempt to load the default + configuration file from I(~/.kube/config.json). + type: path + namespace: + description: + - Namespaces provide a scope for names. Names of resources need to be unique within + a namespace, but not across namespaces. Provide the namespace for the object. + password: + description: + - Provide a password for connecting to the API. Use in conjunction with I(username). + ssl_ca_cert: + description: + - Path to a CA certificate used to authenticate with the API. + type: path + state: + description: + - Determines if the object should be created, patched, deleted or replaced. When + set to C(present), the object will be created, if it does not exist, or patched, + if requested parameters differ from existing object attributes. If set to C(absent), + an existing object will be deleted, and if set to C(replaced), an existing object + will be completely replaced with a new object created from the supplied parameters. + default: present + choices: + - present + - absent + - replaced + username: + description: + - Provide a username for connecting to the API. + verify_ssl: + description: + - Whether or not to verify the API server's SSL certificates. + type: bool +requirements: +- openshift == 1.0.0-snapshot +''' + +EXAMPLES = ''' +''' + +RETURN = ''' +api_version: + type: string + description: Requested API version +job_list: + type: complex + returned: when I(state) = C(present) + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + type: str + items: + description: + - Items is the list of Job. + type: list + contains: + api_version: + description: + - APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, + and may reject unrecognized values. + type: str + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. + type: str + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a resource + that may be set by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be preserved when modifying + objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This is used + to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before + order across separate operations. Clients may not set this value. + It is represented in RFC3339 form and is in UTC. Populated by the + system. Read-only. Null for lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this resource + will be deleted. This field is set by the server when a graceful deletion + is requested by the user, and is not directly settable by a client. + The resource is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. Populated by the system when a graceful deletion + is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. Each + entry is an identifier for the responsible component that will remove + the entry from the list. If the deletionTimestamp of the object is + non-nil, entries in this list can only be removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to generate + a unique name ONLY IF the Name field has not been provided. If this + field is used, the name returned to the client will be different than + the name passed. This value will also be combined with a unique suffix. + The provided value has the same validation rules as the Name field, + and may be truncated by the length of the suffix required to make + the value unique on the server. If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). Applied only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the desired + state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers + and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request the + generation of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration definition. Cannot + be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. An empty + namespace is equivalent to the "default" namespace, but "default" + is the canonical representation. Not all objects are required to be + scoped to a namespace - the value of this field for those objects + will be empty. Must be a DNS_LABEL. Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in the list + have been deleted, this object will be garbage collected. If this + object is managed by a controller, then an entry in this list will + point to this controller, with the controller field set to true. There + cannot be more than one managing controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this object + that can be used by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, and the + watch operation on a resource or set of resources. Clients must treat + these values as opaque and passed unmodified back to the server. They + may only be valid for a particular resource or set of resources. Populated + by the system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. + Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. It is typically + generated by the server on successful creation of a resource and is + not allowed to change on PUT operations. Populated by the system. + Read-only. + type: str + spec: + description: + - Spec is a structure defining the expected behavior of a job. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds relative to the startTime that the job + may be active before the system tries to terminate it; value must + be positive integer + type: int + completions: + description: + - Completions specifies the desired number of successfully finished + pods the job should be run with. Setting to nil means that the success + of any pod signals the success of all pods, and allows parallelism + to have any positive value. Setting to 1 means that parallelism is + limited to 1 and the success of that pod signals the success of the + job. + type: int + manual_selector: + description: + - ManualSelector controls generation of pod labels and pod selectors. + Leave `manualSelector` unset unless you are certain what you are doing. + When false or unset, the system pick labels unique to this job and + appends those labels to the pod template. When true, the user is responsible + for picking unique labels and specifying the selector. Failure to + pick a unique label may cause this and other jobs to not function + correctly. However, You may see `manualSelector=true` in jobs that + were created with the old `extensions/v1beta1` API. + type: bool + parallelism: + description: + - Parallelism specifies the maximum desired number of pods the job should + run at any given time. The actual number of pods running in steady + state will be less than this number when ((.spec.completions - .status.successful) + < .spec.parallelism), i.e. when the work left to do is less than max + parallelism. + type: int + selector: + description: + - Selector is a label query over pods that should match the pod count. + Normally, the system sets this field for you. + type: complex + contains: + match_expressions: + description: + - matchExpressions is a list of label selector requirements. The + requirements are ANDed. + type: list + contains: + key: + description: + - key is the label key that the selector applies to. + type: str + operator: + description: + - operator represents a key's relationship to a set of values. + Valid operators ard In, NotIn, Exists and DoesNotExist. + type: str + values: + description: + - values is an array of string values. If the operator is In + or NotIn, the values array must be non-empty. If the operator + is Exists or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge patch. + type: list + contains: str + match_labels: + description: + - 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. + type: complex + contains: str, str + template: + description: + - Template is the object that describes the pod that will be created + when executing a job. + type: complex + contains: + metadata: + description: + - Standard object's metadata. + type: complex + contains: + annotations: + description: + - Annotations is an unstructured key value map stored with a + resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. + type: complex + contains: str, str + cluster_name: + description: + - The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right + now and apiserver is going to ignore it if set in create or + update request. + type: str + creation_timestamp: + description: + - CreationTimestamp is a timestamp representing the server time + when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients + may not set this value. It is represented in RFC3339 form + and is in UTC. Populated by the system. Read-only. Null for + lists. + type: complex + contains: {} + deletion_grace_period_seconds: + description: + - Number of seconds allowed for this object to gracefully terminate + before it will be removed from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + type: int + deletion_timestamp: + description: + - DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server + when a graceful deletion is requested by the user, and is + not directly settable by a client. The resource is expected + to be deleted (no longer visible from resource lists, and + not reachable by name) after the time in this field. Once + set, this value may not be unset or be set further into the + future, although it may be shortened or the resource may be + deleted prior to this time. For example, a user may request + that a pod is deleted in 30 seconds. The Kubelet will react + by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a + hard termination signal (SIGKILL) to the container and after + cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, + until an administrator or automated process can determine + the resource is fully terminated. If not set, graceful deletion + of the object has not been requested. Populated by the system + when a graceful deletion is requested. Read-only. + type: complex + contains: {} + finalizers: + description: + - Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component + that will remove the entry from the list. If the deletionTimestamp + of the object is non-nil, entries in this list can only be + removed. + type: list + contains: str + generate_name: + description: + - GenerateName is an optional prefix, used by the server, to + generate a unique name ONLY IF the Name field has not been + provided. If this field is used, the name returned to the + client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the + value unique on the server. If this field is specified and + the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found + in the time allotted, and the client should retry (optionally + after the time indicated in the Retry-After header). Applied + only if Name is not specified. + type: str + generation: + description: + - A sequence number representing a specific generation of the + desired state. Populated by the system. Read-only. + type: int + labels: + description: + - Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors + of replication controllers and services. + type: complex + contains: str, str + name: + description: + - Name must be unique within a namespace. Is required when creating + resources, although some resources may allow a client to request + the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration + definition. Cannot be updated. + type: str + namespace: + description: + - Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the "default" namespace, + but "default" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this + field for those objects will be empty. Must be a DNS_LABEL. + Cannot be updated. + type: str + owner_references: + description: + - List of objects depended by this object. If ALL objects in + the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing + controller. + type: list + contains: + api_version: + description: + - API version of the referent. + type: str + controller: + description: + - If true, this reference points to the managing controller. + type: bool + kind: + description: + - Kind of the referent. + type: str + name: + description: + - Name of the referent. + type: str + uid: + description: + - UID of the referent. + type: str + resource_version: + description: + - An opaque value that represents the internal version of this + object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change + detection, and the watch operation on a resource or set of + resources. Clients must treat these values as opaque and passed + unmodified back to the server. They may only be valid for + a particular resource or set of resources. Populated by the + system. Read-only. Value must be treated as opaque by clients + and . + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the + system. Read-only. + type: str + uid: + description: + - UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation + of a resource and is not allowed to change on PUT operations. + Populated by the system. Read-only. + type: str + spec: + description: + - Specification of the desired behavior of the pod. + type: complex + contains: + active_deadline_seconds: + description: + - Optional duration in seconds the pod may be active on the + node relative to StartTime before the system will actively + try to mark it failed and kill associated containers. Value + must be a positive integer. + type: int + containers: + description: + - List of containers belonging to the pod. Containers cannot + currently be added or removed. There must be at least one + container in a Pod. Cannot be updated. + type: list + contains: + args: + description: + - "Arguments to the entrypoint. The docker image's CMD is\ + \ used if this is not provided. Variable references $(VAR_NAME)\ + \ are expanded using the container's environment. If a\ + \ variable cannot be resolved, the reference in the input\ + \ string will be unchanged. The $(VAR_NAME) syntax can\ + \ be escaped with a double $$, ie: $$(VAR_NAME). Escaped\ + \ references will never be expanded, regardless of whether\ + \ the variable exists or not. Cannot be updated." + type: list + contains: str + command: + description: + - "Entrypoint array. Not executed within a shell. The docker\ + \ image's ENTRYPOINT is used if this is not provided.\ + \ Variable references $(VAR_NAME) are expanded using the\ + \ container's environment. If a variable cannot be resolved,\ + \ the reference in the input string will be unchanged.\ + \ The $(VAR_NAME) syntax can be escaped with a double\ + \ $$, ie: $$(VAR_NAME). Escaped references will never\ + \ be expanded, regardless of whether the variable exists\ + \ or not. Cannot be updated." + type: list + contains: str + env: + description: + - List of environment variables to set in the container. + Cannot be updated. + type: list + contains: + name: + description: + - Name of the environment variable. Must be a C_IDENTIFIER. + type: str + value: + description: + - 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the + container and any service environment variables. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to + "".' + type: str + value_from: + description: + - Source for the environment variable's value. Cannot + be used if value is not empty. + type: complex + contains: + config_map_key_ref: + description: + - Selects a key of a ConfigMap. + type: complex + contains: + key: + description: + - The key to select. + type: str + name: + description: + - Name of the referent. + type: str + field_ref: + description: + - 'Selects a field of the pod: supports metadata.name, + metadata.namespace, metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, status.podIP.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + secret_key_ref: + description: + - Selects a key of a secret in the pod's namespace + type: complex + contains: + key: + description: + - The key of the secret to select from. Must + be a valid secret key. + type: str + name: + description: + - Name of the referent. + type: str + image: + description: + - Docker image name. + type: str + image_pull_policy: + description: + - Image pull policy. One of Always, Never, IfNotPresent. + Defaults to Always if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. + type: str + lifecycle: + description: + - Actions that the management system should take in response + to container lifecycle events. Cannot be updated. + type: complex + contains: + post_start: + description: + - PostStart is called immediately after a container + is created. If the handler fails, the container is + terminated and restarted according to its restart + policy. Other management of the container blocks until + the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + pre_stop: + description: + - PreStop is called immediately before a container is + terminated. The container is terminated after the + handler completes. The reason for termination is passed + to the handler. Regardless of the outcome of the handler, + the container is eventually terminated. Other management + of the container blocks until the hook completes. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the + command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run + inside a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + type: list + contains: str + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP + allows repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. + Defaults to HTTP. + type: str + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the + container. Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + type: complex + contains: {} + liveness_probe: + description: + - Periodic probe of container liveness. Container will be + restarted if the probe fails. Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + name: + description: + - Name of the container specified as a DNS_LABEL. Each container + in a pod must have a unique name (DNS_LABEL). Cannot be + updated. + type: str + ports: + description: + - List of ports to expose from the container. Exposing a + port here gives the system additional information about + the network connections a container uses, but is primarily + informational. Not specifying a port here DOES NOT prevent + that port from being exposed. Any port which is listening + on the default "0.0.0.0" address inside a container will + be accessible from the network. Cannot be updated. + type: list + contains: + container_port: + description: + - Number of port to expose on the pod's IP address. + This must be a valid port number, 0 < x < 65536. + type: int + host_ip: + description: + - What host IP to bind the external port to. + type: str + host_port: + description: + - Number of port to expose on the host. If specified, + this must be a valid port number, 0 < x < 65536. If + HostNetwork is specified, this must match ContainerPort. + Most containers do not need this. + type: int + name: + description: + - If specified, this must be an IANA_SVC_NAME and unique + within the pod. Each named port in a pod must have + a unique name. Name for the port that can be referred + to by services. + type: str + protocol: + description: + - Protocol for port. Must be UDP or TCP. Defaults to + "TCP". + type: str + readiness_probe: + description: + - Periodic probe of container service readiness. Container + will be removed from service endpoints if the probe fails. + Cannot be updated. + type: complex + contains: + _exec: + description: + - One and only one of the following should be specified. + Exec specifies the action to take. + type: complex + contains: + command: + description: + - Command is the command line to execute inside + the container, the working directory for the command + is root ('/') in the container's filesystem. The + command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + type: list + contains: str + failure_threshold: + description: + - Minimum consecutive failures for the probe to be considered + failed after having succeeded. Defaults to 3. Minimum + value is 1. + type: int + http_get: + description: + - HTTPGet specifies the http request to perform. + type: complex + contains: + host: + description: + - Host name to connect to, defaults to the pod IP. + You probably want to set "Host" in httpHeaders + instead. + type: str + http_headers: + description: + - Custom headers to set in the request. HTTP allows + repeated headers. + type: list + contains: + name: + description: + - The header field name + type: str + value: + description: + - The header field value + type: str + path: + description: + - Path to access on the HTTP server. + type: str + port: + description: + - Name or number of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + scheme: + description: + - Scheme to use for connecting to the host. Defaults + to HTTP. + type: str + initial_delay_seconds: + description: + - Number of seconds after the container has started + before liveness probes are initiated. + type: int + period_seconds: + description: + - How often (in seconds) to perform the probe. Default + to 10 seconds. Minimum value is 1. + type: int + success_threshold: + description: + - Minimum consecutive successes for the probe to be + considered successful after having failed. Defaults + to 1. Must be 1 for liveness. Minimum value is 1. + type: int + tcp_socket: + description: + - TCPSocket specifies an action involving a TCP port. + TCP hooks not yet supported + type: complex + contains: + port: + description: + - Number or name of the port to access on the container. + Number must be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + type: complex + contains: {} + timeout_seconds: + description: + - Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + type: int + resources: + description: + - Compute Resources required by this container. Cannot be + updated. + type: complex + contains: + limits: + description: + - Limits describes the maximum amount of compute resources + allowed. + type: complex + contains: str, ResourceQuantity + requests: + description: + - Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. + type: complex + contains: str, ResourceQuantity + security_context: + description: + - Security options the pod should run with. + type: complex + contains: + capabilities: + description: + - The capabilities to add/drop when running containers. + Defaults to the default set of capabilities granted + by the container runtime. + type: complex + contains: + add: + description: + - Added capabilities + type: list + contains: str + drop: + description: + - Removed capabilities + type: list + contains: str + privileged: + description: + - Run container in privileged mode. Processes in privileged + containers are essentially equivalent to root on the + host. Defaults to false. + type: bool + read_only_root_filesystem: + description: + - Whether this container has a read-only root filesystem. + Default is false. + type: bool + run_as_non_root: + description: + - Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image + at runtime to ensure that it does not run as UID 0 + (root) and fail to start the container if it does. + If unset or false, no such validation will be performed. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: int + se_linux_options: + description: + - The SELinux context to be applied to the container. + If unspecified, the container runtime will allocate + a random SELinux context for each container. May also + be set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the + container. + type: str + role: + description: + - Role is a SELinux role label that applies to the + container. + type: str + type: + description: + - Type is a SELinux type label that applies to the + container. + type: str + user: + description: + - User is a SELinux user label that applies to the + container. + type: str + stdin: + description: + - Whether this container should allocate a buffer for stdin + in the container runtime. If this is not set, reads from + stdin in the container will always result in EOF. Default + is false. + type: bool + stdin_once: + description: + - Whether the container runtime should close the stdin channel + after it has been opened by a single attach. When stdin + is true the stdin stream will remain open across multiple + attach sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the first client + attaches to stdin, and then remains open and accepts data + until the client disconnects, at which time stdin is closed + and remains closed until the container is restarted. If + this flag is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: bool + termination_message_path: + description: + - "Optional: Path at which the file to which the container's\ + \ termination message will be written is mounted into\ + \ the container's filesystem. Message written is intended\ + \ to be brief final status, such as an assertion failure\ + \ message. Defaults to /dev/termination-log. Cannot be\ + \ updated." + type: str + tty: + description: + - Whether this container should allocate a TTY for itself, + also requires 'stdin' to be true. Default is false. + type: bool + volume_mounts: + description: + - Pod volumes to mount into the container's filesystem. + Cannot be updated. + type: list + contains: + mount_path: + description: + - Path within the container at which the volume should + be mounted. Must not contain ':'. + type: str + name: + description: + - This must match the Name of a Volume. + type: str + read_only: + description: + - Mounted read-only if true, read-write otherwise (false + or unspecified). Defaults to false. + type: bool + sub_path: + description: + - Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's + root). + type: str + working_dir: + description: + - Container's working directory. If not specified, the container + runtime's default will be used, which might be configured + in the container image. Cannot be updated. + type: str + dns_policy: + description: + - Set DNS policy for containers within the pod. One of 'ClusterFirst' + or 'Default'. Defaults to "ClusterFirst". + type: str + host_ipc: + description: + - "Use the host's ipc namespace. Optional: Default to false." + type: bool + host_network: + description: + - Host networking requested for this pod. Use the host's network + namespace. If this option is set, the ports that will be used + must be specified. Default to false. + type: bool + host_pid: + description: + - "Use the host's pid namespace. Optional: Default to false." + type: bool + hostname: + description: + - Specifies the hostname of the Pod If not specified, the pod's + hostname will be set to a system-defined value. + type: str + image_pull_secrets: + description: + - ImagePullSecrets is an optional list of references to secrets + in the same namespace to use for pulling any of the images + used by this PodSpec. If specified, these secrets will be + passed to individual puller implementations for them to use. + For example, in the case of docker, only DockerConfig type + secrets are honored. + type: list + contains: + name: + description: + - Name of the referent. + type: str + node_name: + description: + - NodeName is a request to schedule this pod onto a specific + node. If it is non-empty, the scheduler simply schedules this + pod onto that node, assuming that it fits resource requirements. + type: str + node_selector: + description: + - NodeSelector is a selector which must be true for the pod + to fit on a node. Selector which must match a node's labels + for the pod to be scheduled on that node. + type: complex + contains: str, str + restart_policy: + description: + - Restart policy for all containers within the pod. One of Always, + OnFailure, Never. Default to Always. + type: str + security_context: + description: + - 'SecurityContext holds pod-level security attributes and common + container settings. Optional: Defaults to empty. See type + description for default values of each field.' + type: complex + contains: + fs_group: + description: + - "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 owned by the pod:\ + \ 1. The owning GID will be the FSGroup 2. The setgid\ + \ bit is set (new files created in the volume will be\ + \ owned by FSGroup) 3. The permission bits are OR'd with\ + \ rw-rw---- If unset, the Kubelet will not modify the\ + \ ownership and permissions of any volume." + type: int + run_as_non_root: + description: + - Indicates that the container must run as a non-root user. + If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail + to start the container if it does. If unset or false, + no such validation will be performed. May also be set + in SecurityContext. If set in both SecurityContext and + PodSecurityContext, the value specified in SecurityContext + takes precedence. + type: bool + run_as_user: + description: + - The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + type: int + se_linux_options: + description: + - The SELinux context to be applied to all containers. If + unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence + for that container. + type: complex + contains: + level: + description: + - Level is SELinux level label that applies to the container. + type: str + role: + description: + - Role is a SELinux role label that applies to the container. + type: str + type: + description: + - Type is a SELinux type label that applies to the container. + type: str + user: + description: + - User is a SELinux user label that applies to the container. + type: str + supplemental_groups: + description: + - A list of groups applied to the first process run in each + container, in addition to the container's primary GID. + If unspecified, no groups will be added to any container. + type: list + contains: int + service_account: + description: + - 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. + Deprecated: Use serviceAccountName instead.' + type: str + service_account_name: + description: + - ServiceAccountName is the name of the ServiceAccount to use + to run this pod. + type: str + subdomain: + description: + - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod + will not have a domainname at all. + type: str + termination_grace_period_seconds: + description: + - Optional duration in seconds the pod needs to terminate gracefully. + May be decreased in delete request. Value must be non-negative + integer. The value zero indicates delete immediately. If this + value is nil, the default grace period will be used instead. + The grace period is the duration in seconds after the processes + running in the pod are sent a termination signal and the time + when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your + process. Defaults to 30 seconds. + type: int + volumes: + description: + - List of volumes that can be mounted by containers belonging + to the pod. + type: list + contains: + aws_elastic_block_store: + description: + - AWSElasticBlockStore represents an AWS Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + read_only: + description: + - Specify "true" to force and set the ReadOnly property + in VolumeMounts to "true". If omitted, the default + is "false". + type: bool + volume_id: + description: + - Unique ID of the persistent disk resource in AWS (Amazon + EBS volume). + type: str + azure_disk: + description: + - AzureDisk represents an Azure Data Disk mount on the host + and bind mount to the pod. + type: complex + contains: + caching_mode: + description: + - 'Host Caching mode: None, Read Only, Read Write.' + type: str + disk_name: + description: + - The Name of the data disk in the blob storage + type: str + disk_uri: + description: + - The URI the data disk in the blob storage + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + azure_file: + description: + - AzureFile represents an Azure File Service mount on the + host and bind mount to the pod. + type: complex + contains: + read_only: + description: + - Defaults to false (read/write). ReadOnly here will + force the ReadOnly setting in VolumeMounts. + type: bool + secret_name: + description: + - the name of secret that contains Azure Storage Account + Name and Key + type: str + share_name: + description: + - Share Name + type: str + cephfs: + description: + - CephFS represents a Ceph FS mount on the host that shares + a pod's lifetime + type: complex + contains: + monitors: + description: + - 'Required: Monitors is a collection of Ceph monitors' + type: list + contains: str + path: + description: + - 'Optional: Used as the mounted root, rather than the + full Ceph tree, default is /' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_file: + description: + - 'Optional: SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret' + type: str + secret_ref: + description: + - 'Optional: SecretRef is reference to the authentication + secret for User, default is empty.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - 'Optional: User is the rados user name, default is + admin' + type: str + cinder: + description: + - Cinder represents a cinder volume attached and mounted + on kubelets host machine + type: complex + contains: + fs_type: + description: + - 'Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified.' + type: str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + volume_id: + description: + - volume id used to identify the volume in cinder + type: str + config_map: + description: + - ConfigMap represents a configMap that should populate + this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced ConfigMap will be projected into + the volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the ConfigMap, the volume setup will + error. Paths must be relative and may not contain + the '..' path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + name: + description: + - Name of the referent. + type: str + downward_api: + description: + - DownwardAPI represents downward API about the pod that + should populate this volume + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - "Required: Path is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + empty_dir: + description: + - EmptyDir represents a temporary directory that shares + a pod's lifetime. + type: complex + contains: + medium: + description: + - What type of storage medium should back this directory. + The default is "" which means to use the node's default + medium. Must be an empty string (default) or Memory. + type: str + fc: + description: + - FC represents a Fibre Channel resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + lun: + description: + - 'Required: FC target lun number' + type: int + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + target_ww_ns: + description: + - 'Required: FC target worldwide names (WWNs)' + type: list + contains: str + flex_volume: + description: + - FlexVolume represents a generic volume resource that is + provisioned/attached using an exec based plugin. This + is an alpha feature and may change in future. + type: complex + contains: + driver: + description: + - Driver is the name of the driver to use for this volume. + type: str + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". The default filesystem depends on FlexVolume + script. + type: str + options: + description: + - 'Optional: Extra command options if any.' + type: complex + contains: str, str + read_only: + description: + - 'Optional: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts.' + type: bool + secret_ref: + description: + - 'Optional: SecretRef is reference to the secret object + containing sensitive information to pass to the plugin + scripts. This may be empty if no secret object is + specified. If the secret object contains more than + one secret, all secrets are passed to the plugin scripts.' + type: complex + contains: + name: + description: + - Name of the referent. + type: str + flocker: + description: + - Flocker represents a Flocker volume attached to a kubelet's + host machine. This depends on the Flocker control service + being running + type: complex + contains: + dataset_name: + description: + - Name of the dataset stored as metadata -> name on + the dataset for Flocker should be considered as deprecated + type: str + dataset_uuid: + description: + - UUID of the dataset. This is unique identifier of + a Flocker dataset + type: str + gce_persistent_disk: + description: + - GCEPersistentDisk represents a GCE Disk resource that + is attached to a kubelet's host machine and then exposed + to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + partition: + description: + - 'The partition in the volume that you want to mount. + If omitted, the default is to mount by volume name. + Examples: For volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for /dev/sda + is "0" (or you can leave the property empty).' + type: int + pd_name: + description: + - Unique name of the PD resource in GCE. Used to identify + the disk in GCE. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + git_repo: + description: + - GitRepo represents a git repository at a particular revision. + type: complex + contains: + directory: + description: + - Target directory name. Must not contain or start with + '..'. If '.' is supplied, the volume directory will + be the git repository. Otherwise, if specified, the + volume will contain the git repository in the subdirectory + with the given name. + type: str + repository: + description: + - Repository URL + type: str + revision: + description: + - Commit hash for the specified revision. + type: str + glusterfs: + description: + - Glusterfs represents a Glusterfs mount on the host that + shares a pod's lifetime. + type: complex + contains: + endpoints: + description: + - EndpointsName is the endpoint name that details Glusterfs + topology. + type: str + path: + description: + - Path is the Glusterfs volume path. + type: str + read_only: + description: + - ReadOnly here will force the Glusterfs volume to be + mounted with read-only permissions. Defaults to false. + type: bool + host_path: + description: + - HostPath represents a pre-existing file or directory on + the host machine that is directly exposed to the container. + This is generally used for system agents or other privileged + things that are allowed to see the host machine. Most + containers will NOT need this. + type: complex + contains: + path: + description: + - Path of the directory on the host. + type: str + iscsi: + description: + - ISCSI represents an ISCSI Disk resource that is attached + to a kubelet's host machine and then exposed to the pod. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + iqn: + description: + - Target iSCSI Qualified Name. + type: str + iscsi_interface: + description: + - "Optional: Defaults to 'default' (tcp). iSCSI interface\ + \ name that uses an iSCSI transport." + type: str + lun: + description: + - iSCSI target lun number. + type: int + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + target_portal: + description: + - iSCSI target portal. The portal is either an IP or + ip_addr:port if the port is other than default (typically + TCP ports 860 and 3260). + type: str + metadata: + description: + - 'Metadata represents metadata about the pod that should + populate this volume Deprecated: Use downwardAPI instead.' + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - Items is a list of downward API volume file + type: list + contains: + field_ref: + description: + - 'Required: Selects a field of the pod: only annotations, + labels, name and namespace are supported.' + type: complex + contains: + api_version: + description: + - Version of the schema the FieldPath is written + in terms of, defaults to "v1". + type: str + field_path: + description: + - Path of the field to select in the specified + API version. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + name: + description: + - "Required: Name is the relative path name of the\ + \ file to be created. Must not be absolute or\ + \ contain the '..' path. Must be utf-8 encoded.\ + \ The first item of the relative path must not\ + \ start with '..'" + type: str + resource_field_ref: + description: + - 'Selects a resource of the container: only resources + limits and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are currently + supported.' + type: complex + contains: + container_name: + description: + - 'Container name: required for volumes, optional + for env vars' + type: str + divisor: + description: + - Specifies the output format of the exposed + resources, defaults to "1" + type: complex + contains: {} + resource: + description: + - 'Required: resource to select' + type: str + name: + description: + - Volume's name. Must be a DNS_LABEL and unique within the + pod. + type: str + nfs: + description: + - NFS represents an NFS mount on the host that shares a + pod's lifetime + type: complex + contains: + path: + description: + - Path that is exported by the NFS server. + type: str + read_only: + description: + - ReadOnly here will force the NFS export to be mounted + with read-only permissions. Defaults to false. + type: bool + server: + description: + - Server is the hostname or IP address of the NFS server. + type: str + persistent_volume_claim: + description: + - PersistentVolumeClaimVolumeSource represents a reference + to a PersistentVolumeClaim in the same namespace. + type: complex + contains: + claim_name: + description: + - ClaimName is the name of a PersistentVolumeClaim in + the same namespace as the pod using this volume. + type: str + read_only: + description: + - Will force the ReadOnly setting in VolumeMounts. Default + false. + type: bool + photon_persistent_disk: + description: + - PhotonPersistentDisk represents a PhotonController persistent + disk attached and mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + pd_id: + description: + - ID that identifies Photon Controller persistent disk + type: str + quobyte: + description: + - Quobyte represents a Quobyte mount on the host that shares + a pod's lifetime + type: complex + contains: + group: + description: + - Group to map volume access to Default is no group + type: str + read_only: + description: + - ReadOnly here will force the Quobyte volume to be + mounted with read-only permissions. Defaults to false. + type: bool + registry: + description: + - Registry represents a single or multiple Quobyte Registry + services specified as a string as host:port pair (multiple + entries are separated with commas) which acts as the + central registry for volumes + type: str + user: + description: + - User to map volume access to Defaults to serivceaccount + user + type: str + volume: + description: + - Volume is a string that references an already created + Quobyte volume by name. + type: str + rbd: + description: + - RBD represents a Rados Block Device mount on the host + that shares a pod's lifetime. + type: complex + contains: + fs_type: + description: + - 'Filesystem type of the volume that you want to mount. + Tip: Ensure that the filesystem type is supported + by the host operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if unspecified.' + type: str + image: + description: + - The rados image name. + type: str + keyring: + description: + - Keyring is the path to key ring for RBDUser. Default + is /etc/ceph/keyring. + type: str + monitors: + description: + - A collection of Ceph monitors. + type: list + contains: str + pool: + description: + - The rados pool name. Default is rbd. + type: str + read_only: + description: + - ReadOnly here will force the ReadOnly setting in VolumeMounts. + Defaults to false. + type: bool + secret_ref: + description: + - SecretRef is name of the authentication secret for + RBDUser. If provided overrides keyring. Default is + nil. + type: complex + contains: + name: + description: + - Name of the referent. + type: str + user: + description: + - The rados user name. Default is admin. + type: str + secret: + description: + - Secret represents a secret that should populate this volume. + type: complex + contains: + default_mode: + description: + - 'Optional: mode bits to use on created files by default. + Must be a value between 0 and 0777. Defaults to 0644. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set.' + type: int + items: + description: + - If unspecified, each key-value pair in the Data field + of the referenced Secret will be projected into the + volume as a file whose name is the key and content + is the value. If specified, the listed keys will be + projected into the specified paths, and unlisted keys + will not be present. If a key is specified which is + not present in the Secret, the volume setup will error. + Paths must be relative and may not contain the '..' + path or start with '..'. + type: list + contains: + key: + description: + - The key to project. + type: str + mode: + description: + - 'Optional: mode bits to use on this file, must + be a value between 0 and 0777. If not specified, + the volume defaultMode will be used. This might + be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' + type: int + path: + description: + - The relative path of the file to map the key to. + May not be an absolute path. May not contain the + path element '..'. May not start with the string + '..'. + type: str + secret_name: + description: + - Name of the secret in the pod's namespace to use. + type: str + vsphere_volume: + description: + - VsphereVolume represents a vSphere volume attached and + mounted on kubelets host machine + type: complex + contains: + fs_type: + description: + - Filesystem type to mount. Must be a filesystem type + supported by the host operating system. Ex. "ext4", + "xfs", "ntfs". Implicitly inferred to be "ext4" if + unspecified. + type: str + volume_path: + description: + - Path that identifies vSphere volume vmdk + type: str + status: + description: + - Status is a structure describing current status of a job. + type: complex + contains: + active: + description: + - Active is the number of actively running pods. + type: int + completion_time: + description: + - CompletionTime represents time when the job was completed. It is not + guaranteed to be set in happens-before order across separate operations. + It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + conditions: + description: + - Conditions represent the latest available observations of an object's + current state. + type: list + contains: + last_probe_time: + description: + - Last time the condition was checked. + type: complex + contains: {} + last_transition_time: + description: + - Last time the condition transit from one status to another. + type: complex + contains: {} + message: + description: + - Human readable message indicating details about last transition. + type: str + reason: + description: + - (brief) reason for the condition's last transition. + type: str + status: + description: + - Status of the condition, one of True, False, Unknown. + type: str + type: + description: + - Type of job condition, Complete or Failed. + type: str + failed: + description: + - Failed is the number of pods which reached Phase Failed. + type: int + start_time: + description: + - StartTime represents time when the job was acknowledged by the Job + Manager. It is not guaranteed to be set in happens-before order across + separate operations. It is represented in RFC3339 form and is in UTC. + type: complex + contains: {} + succeeded: + description: + - Succeeded is the number of pods which reached Phase Succeeded. + type: int + kind: + description: + - Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. + type: str + metadata: + description: + - Standard list metadata + type: complex + contains: + resource_version: + description: + - String that identifies the server's internal version of this object that + can be used by clients to determine when objects have changed. Value must + be treated as opaque by clients and passed unmodified back to the server. + Populated by the system. Read-only. + type: str + self_link: + description: + - SelfLink is a URL representing this object. Populated by the system. Read-only. + type: str +''' + + +def main(): + try: + module = OpenShiftAnsibleModule('job_list', 'V2alpha1') + except OpenShiftAnsibleException as exc: + # The helper failed to init, so there is no module object. All we can do is raise the error. + raise Exception(exc.message) + + try: + module.execute_module() + except OpenShiftAnsibleException as exc: + module.fail_json(msg="Module failed!", error=str(exc)) + + +if __name__ == '__main__': + main() + diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 00000000..2e1a9144 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,222 @@ +galaxy_info: + author: your name + description: your description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Some suggested licenses: + # - BSD (default) + # - MIT + # - GPLv2 + # - GPLv3 + # - Apache + # - CC-BY + license: license (GPLv2, CC-BY, etc) + + min_ansible_version: 1.2 + + # Optionally specify the branch Galaxy will use when accessing the GitHub + # repo for this role. During role install, if no tags are available, + # Galaxy will use this branch. During import Galaxy will access files on + # this branch. If travis integration is cofigured, only notification for this + # branch will be accepted. Otherwise, in all cases, the repo's default branch + # (usually master) will be used. + #github_branch: + + # + # Below are all platforms currently available. Just uncomment + # the ones that apply to your role. If you don't see your + # platform on this list, let us know and we'll get it added! + # + #platforms: + #- name: OpenBSD + # versions: + # - all + # - 5.6 + # - 5.7 + # - 5.8 + # - 5.9 + # - 6.0 + #- name: Fedora + # versions: + # - all + # - 16 + # - 17 + # - 18 + # - 19 + # - 20 + # - 21 + # - 22 + # - 23 + # - 24 + # - 25 + #- name: DellOS + # versions: + # - all + # - 10 + # - 6 + # - 9 + #- name: MacOSX + # versions: + # - all + # - 10.10 + # - 10.11 + # - 10.12 + # - 10.7 + # - 10.8 + # - 10.9 + #- name: Synology + # versions: + # - all + # - any + #- name: Junos + # versions: + # - all + # - any + #- name: GenericBSD + # versions: + # - all + # - any + #- name: Void Linux + # versions: + # - all + # - any + #- name: GenericLinux + # versions: + # - all + # - any + #- name: NXOS + # versions: + # - all + # - any + #- name: IOS + # versions: + # - all + # - any + #- name: Amazon + # versions: + # - all + # - 2013.03 + # - 2013.09 + # - 2016.03 + # - 2016.09 + #- name: ArchLinux + # versions: + # - all + # - any + #- name: FreeBSD + # versions: + # - all + # - 10.0 + # - 10.1 + # - 10.2 + # - 10.3 + # - 11.0 + # - 8.0 + # - 8.1 + # - 8.2 + # - 8.3 + # - 8.4 + # - 9.0 + # - 9.1 + # - 9.1 + # - 9.2 + # - 9.3 + #- name: Ubuntu + # versions: + # - all + # - lucid + # - maverick + # - natty + # - oneiric + # - precise + # - quantal + # - raring + # - saucy + # - trusty + # - utopic + # - vivid + # - wily + # - xenial + # - yakkety + #- name: Debian + # versions: + # - all + # - etch + # - jessie + # - lenny + # - sid + # - squeeze + # - stretch + # - wheezy + #- name: Alpine + # versions: + # - all + # - any + #- name: EL + # versions: + # - all + # - 5 + # - 6 + # - 7 + #- name: Windows + # versions: + # - all + # - 2012R2 + #- name: SmartOS + # versions: + # - all + # - any + #- name: opensuse + # versions: + # - all + # - 12.1 + # - 12.2 + # - 12.3 + # - 13.1 + # - 13.2 + #- name: SLES + # versions: + # - all + # - 10SP3 + # - 10SP4 + # - 11 + # - 11SP1 + # - 11SP2 + # - 11SP3 + # - 11SP4 + # - 12 + # - 12SP1 + #- name: GenericUNIX + # versions: + # - all + # - any + #- name: Solaris + # versions: + # - all + # - 10 + # - 11.0 + # - 11.1 + # - 11.2 + # - 11.3 + #- name: eos + # versions: + # - all + # - Any + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is + # a keyword that describes and categorizes the role. + # Users find roles by searching for tags. Be sure to + # remove the '[]' above if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of + # alphanumeric characters. Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. + # Be sure to remove the '[]' above if you add dependencies + # to this list. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..3f05d82c --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +-e git+https://github.com/openshift/openshift-restclient-python.git#egg=openshift diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 00000000..be8edd53 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,8 @@ +# tasks/main.yml +--- + +- name: Intall role requirements + pip: + requirements: ../requirements.txt + when: install_python_requirements + diff --git a/tests/KubeObjHelper.log b/tests/KubeObjHelper.log new file mode 100644 index 00000000..b0dd2553 --- /dev/null +++ b/tests/KubeObjHelper.log @@ -0,0 +1,2392 @@ +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "description": { + "description": [ + "Provides a brief overview or narrative for the project." + ] + }, + "display_name": { + "description": [ + "Provides a descriptive name for the project." + ] + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_finalizers": { + "aliases": [ + "finalizers" + ], + "property_path": [ + "spec", + "finalizers" + ], + "required": false, + "type": "list" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +set_obj_attribute V1Project, ["metadata", "name"] to "hello" +set_obj_attribute V1ObjectMeta, ["name"] to "hello" +Object from params: +{ + "status": null, + "kind": "Project", + "spec": null, + "api_version": "v1", + "metadata": { + "uid": null, + "owner_references": null, + "generation": null, + "namespace": null, + "labels": null, + "generate_name": null, + "deletion_timestamp": null, + "cluster_name": null, + "finalizers": null, + "deletion_grace_period_seconds": null, + "self_link": null, + "resource_version": null, + "creation_timestamp": null, + "annotations": { + "openshift.io/display-name": "Shiny Foo", + "openshift.io/description": "W00T! Bitches" + }, + "name": "hello" + } +} +STREAM FAILED: HTTPSConnectionPool(host='192.168.64.2', port=8443): Read timed out. +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_cluster_ip": { + "aliases": [ + "cluster_ip" + ], + "property_path": [ + "spec", + "cluster_ip" + ], + "required": false, + "type": "str" + }, + "spec_deprecated_public_i_ps": { + "aliases": [ + "deprecated_public_i_ps" + ], + "property_path": [ + "spec", + "deprecated_public_i_ps" + ], + "required": false, + "type": "list" + }, + "spec_external_i_ps": { + "aliases": [ + "external_i_ps" + ], + "property_path": [ + "spec", + "external_i_ps" + ], + "required": false, + "type": "list" + }, + "spec_external_name": { + "aliases": [ + "external_name" + ], + "property_path": [ + "spec", + "external_name" + ], + "required": false, + "type": "str" + }, + "spec_load_balancer_ip": { + "aliases": [ + "load_balancer_ip" + ], + "property_path": [ + "spec", + "load_balancer_ip" + ], + "required": false, + "type": "str" + }, + "spec_load_balancer_source_ranges": { + "aliases": [ + "load_balancer_source_ranges" + ], + "property_path": [ + "spec", + "load_balancer_source_ranges" + ], + "required": false, + "type": "list" + }, + "spec_ports": { + "aliases": [ + "ports" + ], + "property_path": [ + "spec", + "ports" + ], + "required": false, + "type": "list" + }, + "spec_selector": { + "aliases": [ + "selector" + ], + "property_path": [ + "spec", + "selector" + ], + "required": false, + "type": "dict" + }, + "spec_session_affinity": { + "aliases": [ + "session_affinity" + ], + "property_path": [ + "spec", + "session_affinity" + ], + "required": false, + "type": "str" + }, + "spec_type": { + "aliases": [ + "type" + ], + "choices": {}, + "property_path": [ + "spec", + "type" + ], + "required": false, + "type": "str" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +request_body: +{ + "kind": "Service", + "spec": { + "ports": [ + { + "targetPort": 8080, + "port": 8080, + "name": "web-tcp" + } + ], + "selector": { + "app": "hello" + } + }, + "apiVersion": "v1", + "metadata": { + "labels": { + "app": "hello" + }, + "namespace": "hello", + "name": "hello-service" + } +} +Starting create object +STREAM FAILED: list_namespaced_service() takes exactly 2 arguments (1 given) +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_min_ready_seconds": { + "aliases": [ + "min_ready_seconds" + ], + "property_path": [ + "spec", + "min_ready_seconds" + ], + "required": false, + "type": "int" + }, + "spec_paused": { + "aliases": [ + "paused" + ], + "property_path": [ + "spec", + "paused" + ], + "required": false, + "type": "bool" + }, + "spec_replicas": { + "aliases": [ + "replicas" + ], + "property_path": [ + "spec", + "replicas" + ], + "required": false, + "type": "int" + }, + "spec_revision_history_limit": { + "aliases": [ + "revision_history_limit" + ], + "property_path": [ + "spec", + "revision_history_limit" + ], + "required": false, + "type": "int" + }, + "spec_selector": { + "aliases": [ + "selector" + ], + "property_path": [ + "spec", + "selector" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_active_deadline_seconds": { + "aliases": [ + "strategy_active_deadline_seconds" + ], + "property_path": [ + "spec", + "strategy", + "active_deadline_seconds" + ], + "required": false, + "type": "int" + }, + "spec_strategy_annotations": { + "aliases": [ + "strategy_annotations" + ], + "property_path": [ + "spec", + "strategy", + "annotations" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_custom_params": { + "aliases": [ + "strategy_custom_params" + ], + "property_path": [ + "spec", + "strategy", + "custom_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_labels": { + "aliases": [ + "strategy_labels" + ], + "property_path": [ + "spec", + "strategy", + "labels" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_recreate_params": { + "aliases": [ + "strategy_recreate_params" + ], + "property_path": [ + "spec", + "strategy", + "recreate_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_resources_limits": { + "aliases": [ + "strategy_resources_limits" + ], + "property_path": [ + "spec", + "strategy", + "resources", + "limits" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_resources_requests": { + "aliases": [ + "strategy_resources_requests" + ], + "property_path": [ + "spec", + "strategy", + "resources", + "requests" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_rolling_params": { + "aliases": [ + "strategy_rolling_params" + ], + "property_path": [ + "spec", + "strategy", + "rolling_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_type": { + "aliases": [ + "strategy_type" + ], + "choices": { + "custom_params": "Custom", + "recreate_params": "Recreate", + "rolling_params": "Rolling" + }, + "property_path": [ + "spec", + "strategy", + "type" + ], + "required": false, + "type": "str" + }, + "spec_template_active_deadline_seconds": { + "aliases": [ + "active_deadline_seconds" + ], + "property_path": [ + "spec", + "template", + "spec", + "active_deadline_seconds" + ], + "required": false, + "type": "int" + }, + "spec_template_containers": { + "aliases": [ + "containers" + ], + "property_path": [ + "spec", + "template", + "spec", + "containers" + ], + "required": false, + "type": "list" + }, + "spec_template_dns_policy": { + "aliases": [ + "dns_policy" + ], + "property_path": [ + "spec", + "template", + "spec", + "dns_policy" + ], + "required": false, + "type": "str" + }, + "spec_template_host_ipc": { + "aliases": [ + "host_ipc" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_ipc" + ], + "required": false, + "type": "bool" + }, + "spec_template_host_network": { + "aliases": [ + "host_network" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_network" + ], + "required": false, + "type": "bool" + }, + "spec_template_host_pid": { + "aliases": [ + "host_pid" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_pid" + ], + "required": false, + "type": "bool" + }, + "spec_template_hostname": { + "aliases": [ + "hostname" + ], + "property_path": [ + "spec", + "template", + "spec", + "hostname" + ], + "required": false, + "type": "str" + }, + "spec_template_image_pull_secrets": { + "aliases": [ + "image_pull_secrets" + ], + "property_path": [ + "spec", + "template", + "spec", + "image_pull_secrets" + ], + "required": false, + "type": "list" + }, + "spec_template_metadata_annotations": { + "property_path": [ + "spec", + "template", + "metadata", + "annotations" + ], + "type": "dict" + }, + "spec_template_metadata_labels": { + "property_path": [ + "spec", + "template", + "metadata", + "labels" + ], + "type": "dict" + }, + "spec_template_metadata_name": { + "property_path": [ + "spec", + "template", + "metadata", + "name" + ], + "required": true + }, + "spec_template_metadata_namespace": { + "property_path": [ + "spec", + "template", + "metadata", + "namespace" + ] + }, + "spec_template_node_name": { + "aliases": [ + "node_name" + ], + "property_path": [ + "spec", + "template", + "spec", + "node_name" + ], + "required": false, + "type": "str" + }, + "spec_template_node_selector": { + "aliases": [ + "node_selector" + ], + "property_path": [ + "spec", + "template", + "spec", + "node_selector" + ], + "required": false, + "type": "dict" + }, + "spec_template_restart_policy": { + "aliases": [ + "restart_policy" + ], + "property_path": [ + "spec", + "template", + "spec", + "restart_policy" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_fs_group": { + "aliases": [ + "security_context_fs_group" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "fs_group" + ], + "required": false, + "type": "int" + }, + "spec_template_security_context_run_as_non_root": { + "aliases": [ + "security_context_run_as_non_root" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "run_as_non_root" + ], + "required": false, + "type": "bool" + }, + "spec_template_security_context_run_as_user": { + "aliases": [ + "security_context_run_as_user" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "run_as_user" + ], + "required": false, + "type": "int" + }, + "spec_template_security_context_se_linux_options_level": { + "aliases": [ + "security_context_se_linux_options_level" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "level" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_role": { + "aliases": [ + "security_context_se_linux_options_role" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "role" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_type": { + "aliases": [ + "security_context_se_linux_options_type" + ], + "choices": {}, + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "type" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_user": { + "aliases": [ + "security_context_se_linux_options_user" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "user" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_supplemental_groups": { + "aliases": [ + "security_context_supplemental_groups" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "supplemental_groups" + ], + "required": false, + "type": "list" + }, + "spec_template_service_account": { + "aliases": [ + "service_account" + ], + "property_path": [ + "spec", + "template", + "spec", + "service_account" + ], + "required": false, + "type": "str" + }, + "spec_template_service_account_name": { + "aliases": [ + "service_account_name" + ], + "property_path": [ + "spec", + "template", + "spec", + "service_account_name" + ], + "required": false, + "type": "str" + }, + "spec_template_subdomain": { + "aliases": [ + "subdomain" + ], + "property_path": [ + "spec", + "template", + "spec", + "subdomain" + ], + "required": false, + "type": "str" + }, + "spec_template_termination_grace_period_seconds": { + "aliases": [ + "termination_grace_period_seconds" + ], + "property_path": [ + "spec", + "template", + "spec", + "termination_grace_period_seconds" + ], + "required": false, + "type": "int" + }, + "spec_template_volumes": { + "aliases": [ + "volumes" + ], + "property_path": [ + "spec", + "template", + "spec", + "volumes" + ], + "required": false, + "type": "list" + }, + "spec_test": { + "aliases": [ + "test" + ], + "property_path": [ + "spec", + "test" + ], + "required": false, + "type": "bool" + }, + "spec_triggers": { + "aliases": [ + "triggers" + ], + "property_path": [ + "spec", + "triggers" + ], + "required": false, + "type": "list" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +request_body: +{ + "kind": "DeploymentConfig", + "spec": { + "strategy": { + "type": "Rolling" + }, + "replicas": 1, + "template": { + "spec": { + "containers": [ + { + "image": "openshift/busybox-http-app", + "name": "hello", + "ports": [ + { + "protocol": "TCP", + "name": "web-8100-tcp", + "containerPort": 8080 + } + ] + } + ] + }, + "metadata": { + "labels": { + "app": "hello" + }, + "name": "hello-pod" + } + }, + "selector": { + "app": "hello" + } + }, + "apiVersion": "v1", + "metadata": { + "labels": { + "app": "hello" + }, + "namespace": "hello", + "name": "hello-depoy" + } +} +Starting create object +STREAM FAILED: HTTPSConnectionPool(host='localhost', port=443): Max retries exceeded with url: /oapi/v1/deploymentconfigs?watch=True (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',)) +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "description": { + "description": [ + "Provides a brief overview or narrative for the project." + ] + }, + "display_name": { + "description": [ + "Provides a descriptive name for the project." + ] + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_finalizers": { + "aliases": [ + "finalizers" + ], + "property_path": [ + "spec", + "finalizers" + ], + "required": false, + "type": "list" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +set_obj_attribute V1Project, ["metadata", "name"] to "hello" +set_obj_attribute V1ObjectMeta, ["name"] to "hello" +Object from params: +{ + "status": { + "phase": "Active" + }, + "kind": "Project", + "spec": { + "finalizers": [ + "openshift.io/origin", + "kubernetes" + ] + }, + "api_version": "v1", + "metadata": { + "uid": "f031e667-0f38-11e7-840c-a2a3304da08d", + "owner_references": null, + "generation": null, + "namespace": null, + "labels": null, + "generate_name": null, + "deletion_timestamp": null, + "cluster_name": null, + "finalizers": null, + "deletion_grace_period_seconds": null, + "self_link": "/oapi/v1/projects/hello", + "resource_version": "42262", + "creation_timestamp": "2017-03-22T19:51:28Z", + "annotations": { + "openshift.io/requester": "system:admin", + "openshift.io/sa.scc.supplemental-groups": "1002040000/10000", + "openshift.io/display-name": "Shiny Foo", + "openshift.io/sa.scc.mcs": "s0:c45,c30", + "openshift.io/description": "W00T! Bitches", + "openshift.io/sa.scc.uid-range": "1002040000/10000" + }, + "name": "hello" + } +} +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_cluster_ip": { + "aliases": [ + "cluster_ip" + ], + "property_path": [ + "spec", + "cluster_ip" + ], + "required": false, + "type": "str" + }, + "spec_deprecated_public_i_ps": { + "aliases": [ + "deprecated_public_i_ps" + ], + "property_path": [ + "spec", + "deprecated_public_i_ps" + ], + "required": false, + "type": "list" + }, + "spec_external_i_ps": { + "aliases": [ + "external_i_ps" + ], + "property_path": [ + "spec", + "external_i_ps" + ], + "required": false, + "type": "list" + }, + "spec_external_name": { + "aliases": [ + "external_name" + ], + "property_path": [ + "spec", + "external_name" + ], + "required": false, + "type": "str" + }, + "spec_load_balancer_ip": { + "aliases": [ + "load_balancer_ip" + ], + "property_path": [ + "spec", + "load_balancer_ip" + ], + "required": false, + "type": "str" + }, + "spec_load_balancer_source_ranges": { + "aliases": [ + "load_balancer_source_ranges" + ], + "property_path": [ + "spec", + "load_balancer_source_ranges" + ], + "required": false, + "type": "list" + }, + "spec_ports": { + "aliases": [ + "ports" + ], + "property_path": [ + "spec", + "ports" + ], + "required": false, + "type": "list" + }, + "spec_selector": { + "aliases": [ + "selector" + ], + "property_path": [ + "spec", + "selector" + ], + "required": false, + "type": "dict" + }, + "spec_session_affinity": { + "aliases": [ + "session_affinity" + ], + "property_path": [ + "spec", + "session_affinity" + ], + "required": false, + "type": "str" + }, + "spec_type": { + "aliases": [ + "type" + ], + "choices": {}, + "property_path": [ + "spec", + "type" + ], + "required": false, + "type": "str" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +set_obj_attribute V1Service, ["metadata", "labels"] to {"app": "hello"} +set_obj_attribute V1ObjectMeta, ["labels"] to {"app": "hello"} +set_obj_attribute V1Service, ["spec", "selector"] to {"app": "hello"} +set_obj_attribute V1ServiceSpec, ["selector"] to {"app": "hello"} +set_obj_attribute V1Service, ["spec", "selector"] to {"app": "hello"} +set_obj_attribute V1ServiceSpec, ["selector"] to {"app": "hello"} +set_obj_attribute V1Service, ["metadata", "name"] to "hello-service" +set_obj_attribute V1ObjectMeta, ["name"] to "hello-service" +set_obj_attribute V1Service, ["metadata", "namespace"] to "hello" +set_obj_attribute V1ObjectMeta, ["namespace"] to "hello" +set_obj_attribute V1Service, ["spec", "ports"] to [{"target_port": 8080, "port": 8080, "name": "web-tcp"}] +set_obj_attribute V1ServiceSpec, ["ports"] to [{"target_port": 8080, "port": 8080, "name": "web-tcp"}] +set_obj_attribute V1Service, ["spec", "ports"] to [{"target_port": 8080, "port": 8080, "name": "web-tcp"}] +set_obj_attribute V1ServiceSpec, ["ports"] to [{"target_port": 8080, "port": 8080, "name": "web-tcp"}] +Object from params: +{ + "status": { + "load_balancer": { + "ingress": null + } + }, + "kind": "Service", + "spec": { + "cluster_ip": "172.30.190.55", + "external_i_ps": null, + "load_balancer_ip": null, + "external_name": null, + "deprecated_public_i_ps": null, + "load_balancer_source_ranges": null, + "selector": { + "app": "hello" + }, + "type": "ClusterIP", + "ports": [ + { + "target_port": 8080, + "protocol": "TCP", + "port": 8080, + "name": "web-tcp", + "node_port": null + } + ], + "session_affinity": "None" + }, + "api_version": "v1", + "metadata": { + "uid": "fd228ddb-0f38-11e7-840c-a2a3304da08d", + "owner_references": null, + "generation": null, + "namespace": "hello", + "labels": { + "app": "hello" + }, + "generate_name": null, + "deletion_timestamp": null, + "cluster_name": null, + "finalizers": null, + "deletion_grace_period_seconds": null, + "self_link": "/api/v1/namespaces/hello/services/hello-service", + "resource_version": "42303", + "creation_timestamp": "2017-03-22T19:51:49Z", + "annotations": null, + "name": "hello-service" + } +} +arg_spec: +{ + "annotations": { + "property_path": [ + "metadata", + "annotations" + ], + "type": "dict" + }, + "cert_file": { + "auth_option": true, + "description": [ + "Path to a certificate used to authenticate with the API." + ], + "type": "path" + }, + "context": { + "auth_option": true, + "description": [ + "The name of a context found in the Kubernetes config file." + ] + }, + "debug": { + "default": false, + "description": [ + "Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log" + ], + "type": "bool" + }, + "host": { + "auth_option": true, + "description": [ + "Provide a URL for acessing the Kubernetes API." + ] + }, + "key_file": { + "auth_option": true, + "description": [ + "Path to a key file used to authenticate with the API." + ], + "type": "path" + }, + "kubeconfig": { + "auth_option": true, + "description": [ + "Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the openshift client will attempt to load the default configuration file from I(~/.kube/config.json)." + ], + "type": "path" + }, + "labels": { + "property_path": [ + "metadata", + "labels" + ], + "type": "dict" + }, + "name": { + "property_path": [ + "metadata", + "name" + ], + "required": true + }, + "namespace": { + "property_path": [ + "metadata", + "namespace" + ] + }, + "spec_min_ready_seconds": { + "aliases": [ + "min_ready_seconds" + ], + "property_path": [ + "spec", + "min_ready_seconds" + ], + "required": false, + "type": "int" + }, + "spec_paused": { + "aliases": [ + "paused" + ], + "property_path": [ + "spec", + "paused" + ], + "required": false, + "type": "bool" + }, + "spec_replicas": { + "aliases": [ + "replicas" + ], + "property_path": [ + "spec", + "replicas" + ], + "required": false, + "type": "int" + }, + "spec_revision_history_limit": { + "aliases": [ + "revision_history_limit" + ], + "property_path": [ + "spec", + "revision_history_limit" + ], + "required": false, + "type": "int" + }, + "spec_selector": { + "aliases": [ + "selector" + ], + "property_path": [ + "spec", + "selector" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_active_deadline_seconds": { + "aliases": [ + "strategy_active_deadline_seconds" + ], + "property_path": [ + "spec", + "strategy", + "active_deadline_seconds" + ], + "required": false, + "type": "int" + }, + "spec_strategy_annotations": { + "aliases": [ + "strategy_annotations" + ], + "property_path": [ + "spec", + "strategy", + "annotations" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_custom_params": { + "aliases": [ + "strategy_custom_params" + ], + "property_path": [ + "spec", + "strategy", + "custom_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_labels": { + "aliases": [ + "strategy_labels" + ], + "property_path": [ + "spec", + "strategy", + "labels" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_recreate_params": { + "aliases": [ + "strategy_recreate_params" + ], + "property_path": [ + "spec", + "strategy", + "recreate_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_resources_limits": { + "aliases": [ + "strategy_resources_limits" + ], + "property_path": [ + "spec", + "strategy", + "resources", + "limits" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_resources_requests": { + "aliases": [ + "strategy_resources_requests" + ], + "property_path": [ + "spec", + "strategy", + "resources", + "requests" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_rolling_params": { + "aliases": [ + "strategy_rolling_params" + ], + "property_path": [ + "spec", + "strategy", + "rolling_params" + ], + "required": false, + "type": "dict" + }, + "spec_strategy_type": { + "aliases": [ + "strategy_type" + ], + "choices": { + "custom_params": "Custom", + "recreate_params": "Recreate", + "rolling_params": "Rolling" + }, + "property_path": [ + "spec", + "strategy", + "type" + ], + "required": false, + "type": "str" + }, + "spec_template_active_deadline_seconds": { + "aliases": [ + "active_deadline_seconds" + ], + "property_path": [ + "spec", + "template", + "spec", + "active_deadline_seconds" + ], + "required": false, + "type": "int" + }, + "spec_template_containers": { + "aliases": [ + "containers" + ], + "property_path": [ + "spec", + "template", + "spec", + "containers" + ], + "required": false, + "type": "list" + }, + "spec_template_dns_policy": { + "aliases": [ + "dns_policy" + ], + "property_path": [ + "spec", + "template", + "spec", + "dns_policy" + ], + "required": false, + "type": "str" + }, + "spec_template_host_ipc": { + "aliases": [ + "host_ipc" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_ipc" + ], + "required": false, + "type": "bool" + }, + "spec_template_host_network": { + "aliases": [ + "host_network" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_network" + ], + "required": false, + "type": "bool" + }, + "spec_template_host_pid": { + "aliases": [ + "host_pid" + ], + "property_path": [ + "spec", + "template", + "spec", + "host_pid" + ], + "required": false, + "type": "bool" + }, + "spec_template_hostname": { + "aliases": [ + "hostname" + ], + "property_path": [ + "spec", + "template", + "spec", + "hostname" + ], + "required": false, + "type": "str" + }, + "spec_template_image_pull_secrets": { + "aliases": [ + "image_pull_secrets" + ], + "property_path": [ + "spec", + "template", + "spec", + "image_pull_secrets" + ], + "required": false, + "type": "list" + }, + "spec_template_metadata_annotations": { + "property_path": [ + "spec", + "template", + "metadata", + "annotations" + ], + "type": "dict" + }, + "spec_template_metadata_labels": { + "property_path": [ + "spec", + "template", + "metadata", + "labels" + ], + "type": "dict" + }, + "spec_template_metadata_name": { + "property_path": [ + "spec", + "template", + "metadata", + "name" + ], + "required": true + }, + "spec_template_metadata_namespace": { + "property_path": [ + "spec", + "template", + "metadata", + "namespace" + ] + }, + "spec_template_node_name": { + "aliases": [ + "node_name" + ], + "property_path": [ + "spec", + "template", + "spec", + "node_name" + ], + "required": false, + "type": "str" + }, + "spec_template_node_selector": { + "aliases": [ + "node_selector" + ], + "property_path": [ + "spec", + "template", + "spec", + "node_selector" + ], + "required": false, + "type": "dict" + }, + "spec_template_restart_policy": { + "aliases": [ + "restart_policy" + ], + "property_path": [ + "spec", + "template", + "spec", + "restart_policy" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_fs_group": { + "aliases": [ + "security_context_fs_group" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "fs_group" + ], + "required": false, + "type": "int" + }, + "spec_template_security_context_run_as_non_root": { + "aliases": [ + "security_context_run_as_non_root" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "run_as_non_root" + ], + "required": false, + "type": "bool" + }, + "spec_template_security_context_run_as_user": { + "aliases": [ + "security_context_run_as_user" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "run_as_user" + ], + "required": false, + "type": "int" + }, + "spec_template_security_context_se_linux_options_level": { + "aliases": [ + "security_context_se_linux_options_level" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "level" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_role": { + "aliases": [ + "security_context_se_linux_options_role" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "role" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_type": { + "aliases": [ + "security_context_se_linux_options_type" + ], + "choices": {}, + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "type" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_se_linux_options_user": { + "aliases": [ + "security_context_se_linux_options_user" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "se_linux_options", + "user" + ], + "required": false, + "type": "str" + }, + "spec_template_security_context_supplemental_groups": { + "aliases": [ + "security_context_supplemental_groups" + ], + "property_path": [ + "spec", + "template", + "spec", + "security_context", + "supplemental_groups" + ], + "required": false, + "type": "list" + }, + "spec_template_service_account": { + "aliases": [ + "service_account" + ], + "property_path": [ + "spec", + "template", + "spec", + "service_account" + ], + "required": false, + "type": "str" + }, + "spec_template_service_account_name": { + "aliases": [ + "service_account_name" + ], + "property_path": [ + "spec", + "template", + "spec", + "service_account_name" + ], + "required": false, + "type": "str" + }, + "spec_template_subdomain": { + "aliases": [ + "subdomain" + ], + "property_path": [ + "spec", + "template", + "spec", + "subdomain" + ], + "required": false, + "type": "str" + }, + "spec_template_termination_grace_period_seconds": { + "aliases": [ + "termination_grace_period_seconds" + ], + "property_path": [ + "spec", + "template", + "spec", + "termination_grace_period_seconds" + ], + "required": false, + "type": "int" + }, + "spec_template_volumes": { + "aliases": [ + "volumes" + ], + "property_path": [ + "spec", + "template", + "spec", + "volumes" + ], + "required": false, + "type": "list" + }, + "spec_test": { + "aliases": [ + "test" + ], + "property_path": [ + "spec", + "test" + ], + "required": false, + "type": "bool" + }, + "spec_triggers": { + "aliases": [ + "triggers" + ], + "property_path": [ + "spec", + "triggers" + ], + "required": false, + "type": "list" + }, + "ssl_ca_cert": { + "auth_option": true, + "description": [ + "Path to a CA certificate used to authenticate with the API." + ], + "type": "path" + }, + "state": { + "choices": [ + "present", + "absent", + "replaced" + ], + "default": "present", + "description": [ + "Determines if the object should be created, patched, deleted or replaced. When set to C(present), the object will be created, if it does not exist, or patched, if requested parameters differ from existing object attributes. If set to C(absent), an existing object will be deleted, and if set to C(replaced), an existing object will be completely replaced with a new object created from the supplied parameters." + ] + }, + "username": { + "auth_option": true, + "description": [ + "Provide a username for connecting to the API." + ] + }, + "verify_ssl": { + "auth_option": true, + "description": [ + "Whether or not to verify the API server's SSL certificates." + ], + "type": "bool" + } +} +set_obj_attribute V1DeploymentConfig, ["metadata", "labels"] to {"app": "hello"} +set_obj_attribute V1ObjectMeta, ["labels"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfig, ["spec", "template", "spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1DeploymentConfigSpec, ["template", "spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1PodTemplateSpec, ["spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1PodSpec, ["containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1DeploymentConfig, ["spec", "selector"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfigSpec, ["selector"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfig, ["metadata", "namespace"] to "hello" +set_obj_attribute V1ObjectMeta, ["namespace"] to "hello" +set_obj_attribute V1DeploymentConfig, ["spec", "template", "metadata", "labels"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfigSpec, ["template", "metadata", "labels"] to {"app": "hello"} +set_obj_attribute V1PodTemplateSpec, ["metadata", "labels"] to {"app": "hello"} +set_obj_attribute V1ObjectMeta, ["labels"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfig, ["spec", "template", "spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1DeploymentConfigSpec, ["template", "spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1PodTemplateSpec, ["spec", "containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1PodSpec, ["containers"] to [{"image": "openshift/busybox-http-app", "name": "hello", "ports": [{"protocol": "TCP", "name": "web-8100-tcp", "container_port": 8080}]}] +set_obj_attribute V1DeploymentConfig, ["spec", "replicas"] to 1 +set_obj_attribute V1DeploymentConfigSpec, ["replicas"] to 1 +set_obj_attribute V1DeploymentConfig, ["spec", "template", "metadata", "name"] to "hello-pod" +set_obj_attribute V1DeploymentConfigSpec, ["template", "metadata", "name"] to "hello-pod" +set_obj_attribute V1PodTemplateSpec, ["metadata", "name"] to "hello-pod" +set_obj_attribute V1ObjectMeta, ["name"] to "hello-pod" +set_obj_attribute V1DeploymentConfig, ["spec", "selector"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfigSpec, ["selector"] to {"app": "hello"} +set_obj_attribute V1DeploymentConfig, ["spec", "strategy", "type"] to "Rolling" +set_obj_attribute V1DeploymentConfigSpec, ["strategy", "type"] to "Rolling" +set_obj_attribute V1DeploymentStrategy, ["type"] to "Rolling" +set_obj_attribute V1DeploymentConfig, ["metadata", "name"] to "hello-depoy" +set_obj_attribute V1ObjectMeta, ["name"] to "hello-depoy" +set_obj_attribute V1DeploymentConfig, ["spec", "strategy", "type"] to "Rolling" +set_obj_attribute V1DeploymentConfigSpec, ["strategy", "type"] to "Rolling" +set_obj_attribute V1DeploymentStrategy, ["type"] to "Rolling" +set_obj_attribute V1DeploymentConfig, ["spec", "replicas"] to 1 +set_obj_attribute V1DeploymentConfigSpec, ["replicas"] to 1 +Object from params: +{ + "status": { + "replicas": 1, + "latest_version": 1, + "observed_generation": 2, + "updated_replicas": 1, + "available_replicas": 1, + "details": { + "message": "config change", + "causes": [ + { + "type": "ConfigChange", + "image_trigger": null + } + ] + }, + "ready_replicas": null, + "unavailable_replicas": null, + "conditions": [ + { + "last_update_time": null, + "status": "True", + "last_transition_time": "2017-03-22T19:51:58Z", + "reason": null, + "message": "Deployment config has minimum availability.", + "type": "Available" + }, + { + "last_update_time": null, + "status": "True", + "last_transition_time": "2017-03-22T19:51:55Z", + "reason": "NewReplicationControllerAvailable", + "message": "Replication controller \"hello-depoy-1\" has completed progressing", + "type": "Progressing" + } + ] + }, + "kind": "DeploymentConfig", + "spec": { + "replicas": 1, + "min_ready_seconds": null, + "strategy": { + "custom_params": null, + "rolling_params": { + "pre": null, + "timeout_seconds": 600, + "interval_seconds": 1, + "max_unavailable": "25%", + "post": null, + "max_surge": "25%", + "update_period_seconds": 1 + }, + "labels": null, + "active_deadline_seconds": null, + "type": "Rolling", + "annotations": null, + "resources": { + "requests": null, + "limits": null + }, + "recreate_params": null + }, + "paused": null, + "revision_history_limit": null, + "template": { + "spec": { + "hostname": null, + "service_account": null, + "image_pull_secrets": null, + "service_account_name": null, + "termination_grace_period_seconds": 30, + "restart_policy": "Always", + "node_name": null, + "dns_policy": "ClusterFirst", + "host_ipc": null, + "security_context": { + "fs_group": null, + "run_as_non_root": null, + "se_linux_options": null, + "supplemental_groups": null, + "run_as_user": null + }, + "host_network": null, + "host_pid": null, + "active_deadline_seconds": null, + "subdomain": null, + "volumes": null, + "containers": [ + { + "image_pull_policy": "Always", + "tty": null, + "args": null, + "stdin_once": null, + "name": "hello", + "security_context": null, + "image": "openshift/busybox-http-app", + "stdin": null, + "volume_mounts": null, + "ports": [ + { + "host_port": null, + "protocol": "TCP", + "host_ip": null, + "name": "web-8100-tcp", + "container_port": 8080 + } + ], + "working_dir": null, + "command": null, + "env": null, + "termination_message_path": "/dev/termination-log", + "readiness_probe": null, + "liveness_probe": null, + "lifecycle": null, + "resources": { + "requests": null, + "limits": null + } + } + ], + "node_selector": null + }, + "metadata": { + "uid": null, + "owner_references": null, + "generation": null, + "namespace": null, + "labels": { + "app": "hello" + }, + "generate_name": null, + "deletion_timestamp": null, + "cluster_name": null, + "finalizers": null, + "deletion_grace_period_seconds": null, + "self_link": null, + "resource_version": null, + "creation_timestamp": {}, + "annotations": null, + "name": "hello-pod" + } + }, + "test": false, + "selector": { + "app": "hello" + }, + "triggers": [ + { + "type": "ConfigChange", + "image_change_params": null + } + ] + }, + "api_version": "v1", + "metadata": { + "uid": "fe10ebd6-0f38-11e7-840c-a2a3304da08d", + "owner_references": null, + "generation": 2, + "namespace": "hello", + "labels": { + "app": "hello" + }, + "generate_name": null, + "deletion_timestamp": null, + "cluster_name": null, + "finalizers": null, + "deletion_grace_period_seconds": null, + "self_link": "/oapi/v1/namespaces/hello/deploymentconfigs/hello-depoy", + "resource_version": "42351", + "creation_timestamp": "2017-03-22T19:51:51Z", + "annotations": null, + "name": "hello-depoy" + } +} diff --git a/tests/ansible.cfg b/tests/ansible.cfg new file mode 100644 index 00000000..5865d9e6 --- /dev/null +++ b/tests/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +roles_path=../.. diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 00000000..d18580b3 --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/tests/roles/hello-world/tasks/main.yml b/tests/roles/hello-world/tasks/main.yml new file mode 100644 index 00000000..3c0a9324 --- /dev/null +++ b/tests/roles/hello-world/tasks/main.yml @@ -0,0 +1,62 @@ +- name: Create project + k8s_v1_project: + name: hello + display_name: Shiny Foo + description: W00T! Bitches + debug: yes + register: project + +- debug: var=project + +- name: Create service + k8s_v1_service: + name: hello-service + namespace: hello + state: present + ports: + - port: 8080 + target_port: 8080 + name: web-tcp + selector: + app: hello + labels: + app: hello + debug: yes + register: service + +- debug: var=service + +- name: Create deployment config + k8s_v1_deployment_config: + name: hello-depoy + namespace: hello + state: present + debug: yes + labels: + app: hello + spec_template_metadata_name: hello-pod + spec_template_metadata_labels: + app: hello + containers: + - name: hello + image: openshift/busybox-http-app + ports: + - container_port: 8080 + protocol: TCP + name: web-8100-tcp + replicas: 1 + selector: + app: hello + strategy_type: Rolling + register: create_deployment + +- debug: var=create_deployment + +- name: Create route + k8s_v1_route: + name: hello-route + namespace: hello + host: www.example.com + to_kind: Service + to_name: hello-service + tls_termination: edge diff --git a/tests/test.retry b/tests/test.retry new file mode 100644 index 00000000..2fbb50c4 --- /dev/null +++ b/tests/test.retry @@ -0,0 +1 @@ +localhost diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 00000000..23510a79 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,7 @@ +--- +- hosts: localhost + remote_user: root + roles: + - role: ansible-kubernetes-modules + install_python_requirements: no + - role: hello-world