From f04017ca951437c6220a8ced093b14a5880e1331 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Mon, 22 Feb 2021 16:11:28 +0100 Subject: [PATCH] OpenAPI: Extend the schema to all role variables This is the full implementation of the OpenAPI schema that maps to the currently existing roles defaults variable. Prior to this commit, all variables specified at the spec level that didn't have an entry in the OpenAPI schema at the CRD level were simply ignored, unless --validate=false was specified. This commit fixes that and provide a mapping between the CRD level OpenAPI schema and the variables availabe in /defaults/main.yml. This commit is simply about ensuring one can provide all the available variables. A follow up commit will come to add logic in the OpenAPI schema definition as it can be shown here[1] [1] https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema --- ansible/templates/crd.yml.j2 | 91 ++++++++++++++++++++++++++++++++ deploy/awx-operator.yaml | 91 ++++++++++++++++++++++++++++++++ deploy/crds/awx_v1beta1_crd.yaml | 91 ++++++++++++++++++++++++++++++++ 3 files changed, 273 insertions(+) diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index 7aacb8c3..78d5ec91 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -23,6 +23,18 @@ spec: properties: spec: properties: + deployment_type: + description: Name of the deployment type + type: string + api_version: + description: API version identified + type: string + tower_task_privileged: + description: If a privileged security context should be enabled + type: boolean + tower_admin_user: + description: Username to use for the admin account + type: string tower_hostname: description: The hostname of the instance type: string @@ -38,6 +50,12 @@ spec: tower_secret_key_secret: description: Secret where the secret key can be found type: string + tower_broadcast_websocket_secret: + description: Secret where the broadcast websocket secret can be found + type: string + tower_extra_volumes: + description: Specify extra volumes to add to the application pod + type: string tower_ingress_type: description: The ingress type to use to reach the deployed instance type: string @@ -47,6 +65,12 @@ spec: - ingress - Route - route + tower_ingress_annotations: + description: Annotations to add to the ingress + type: string + tower_ingress_tls_secret: + description: Secret where the ingress TLS secret can be found + type: string tower_route_host: description: The DNS to use to points to the instance type: string @@ -62,6 +86,9 @@ spec: tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string + tower_image: + description: Registry path to the application container to use + type: string tower_image_pull_policy: description: The image pull policy type: string @@ -130,6 +157,70 @@ spec: description: Whether or not to preload data upon Tower instance creation default: true type: boolean + tower_task_args: + type: array + items: + type: string + tower_task_command: + type: array + items: + type: string + tower_web_args: + type: array + items: + type: string + tower_web_command: + type: array + items: + type: string + tower_task_extra_env: + type: string + tower_web_extra_env: + type: string + tower_task_extra_volume_mounts: + type: string + tower_web_extra_volume_mounts: + type: string + tower_redis_image: + description: Registry path to the redis container to use + type: string + tower_postgres_image: + description: Registry path to the PostgreSQL container to use + type: string + tower_postgres_resource_requirements: + description: Resource requirements for the PostgreSQL container + properties: + requests: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + limits: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + type: object + tower_postgres_storage_class: + description: Storage class to use for the PostgreSQL PVC + type: string + tower_postgres_data_path: + description: Path where the PostgreSQL data are located + type: string + ca_trust_bundle: + description: Path where the trusted CA bundle is available + type: string + development_mode: + description: If the deployment should be done in development mode + type: boolean type: object status: properties: diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 65816ae2..9bd17fa2 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -164,6 +164,18 @@ spec: properties: spec: properties: + deployment_type: + description: Name of the deployment type + type: string + api_version: + description: API version identified + type: string + tower_task_privileged: + description: If a privileged security context should be enabled + type: boolean + tower_admin_user: + description: Username to use for the admin account + type: string tower_hostname: description: The hostname of the instance type: string @@ -179,6 +191,12 @@ spec: tower_secret_key_secret: description: Secret where the secret key can be found type: string + tower_broadcast_websocket_secret: + description: Secret where the broadcast websocket secret can be found + type: string + tower_extra_volumes: + description: Specify extra volumes to add to the application pod + type: string tower_ingress_type: description: The ingress type to use to reach the deployed instance type: string @@ -188,6 +206,12 @@ spec: - ingress - Route - route + tower_ingress_annotations: + description: Annotations to add to the ingress + type: string + tower_ingress_tls_secret: + description: Secret where the ingress TLS secret can be found + type: string tower_route_host: description: The DNS to use to points to the instance type: string @@ -203,6 +227,9 @@ spec: tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string + tower_image: + description: Registry path to the application container to use + type: string tower_image_pull_policy: description: The image pull policy type: string @@ -271,6 +298,70 @@ spec: description: Whether or not to preload data upon Tower instance creation default: true type: boolean + tower_task_args: + type: array + items: + type: string + tower_task_command: + type: array + items: + type: string + tower_web_args: + type: array + items: + type: string + tower_web_command: + type: array + items: + type: string + tower_task_extra_env: + type: string + tower_web_extra_env: + type: string + tower_task_extra_volume_mounts: + type: string + tower_web_extra_volume_mounts: + type: string + tower_redis_image: + description: Registry path to the redis container to use + type: string + tower_postgres_image: + description: Registry path to the PostgreSQL container to use + type: string + tower_postgres_resource_requirements: + description: Resource requirements for the PostgreSQL container + properties: + requests: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + limits: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + type: object + tower_postgres_storage_class: + description: Storage class to use for the PostgreSQL PVC + type: string + tower_postgres_data_path: + description: Path where the PostgreSQL data are located + type: string + ca_trust_bundle: + description: Path where the trusted CA bundle is available + type: string + development_mode: + description: If the deployment should be done in development mode + type: boolean type: object status: properties: diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index 7aacb8c3..78d5ec91 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -23,6 +23,18 @@ spec: properties: spec: properties: + deployment_type: + description: Name of the deployment type + type: string + api_version: + description: API version identified + type: string + tower_task_privileged: + description: If a privileged security context should be enabled + type: boolean + tower_admin_user: + description: Username to use for the admin account + type: string tower_hostname: description: The hostname of the instance type: string @@ -38,6 +50,12 @@ spec: tower_secret_key_secret: description: Secret where the secret key can be found type: string + tower_broadcast_websocket_secret: + description: Secret where the broadcast websocket secret can be found + type: string + tower_extra_volumes: + description: Specify extra volumes to add to the application pod + type: string tower_ingress_type: description: The ingress type to use to reach the deployed instance type: string @@ -47,6 +65,12 @@ spec: - ingress - Route - route + tower_ingress_annotations: + description: Annotations to add to the ingress + type: string + tower_ingress_tls_secret: + description: Secret where the ingress TLS secret can be found + type: string tower_route_host: description: The DNS to use to points to the instance type: string @@ -62,6 +86,9 @@ spec: tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string + tower_image: + description: Registry path to the application container to use + type: string tower_image_pull_policy: description: The image pull policy type: string @@ -130,6 +157,70 @@ spec: description: Whether or not to preload data upon Tower instance creation default: true type: boolean + tower_task_args: + type: array + items: + type: string + tower_task_command: + type: array + items: + type: string + tower_web_args: + type: array + items: + type: string + tower_web_command: + type: array + items: + type: string + tower_task_extra_env: + type: string + tower_web_extra_env: + type: string + tower_task_extra_volume_mounts: + type: string + tower_web_extra_volume_mounts: + type: string + tower_redis_image: + description: Registry path to the redis container to use + type: string + tower_postgres_image: + description: Registry path to the PostgreSQL container to use + type: string + tower_postgres_resource_requirements: + description: Resource requirements for the PostgreSQL container + properties: + requests: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + limits: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + type: object + tower_postgres_storage_class: + description: Storage class to use for the PostgreSQL PVC + type: string + tower_postgres_data_path: + description: Path where the PostgreSQL data are located + type: string + ca_trust_bundle: + description: Path where the trusted CA bundle is available + type: string + development_mode: + description: If the deployment should be done in development mode + type: boolean type: object status: properties: