Skip to content

Commit

Permalink
feat: (IAC-1155) Add Support for Setting up SAS Workload Orchestrator (
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpat authored Aug 31, 2023
1 parent 83ee36d commit ece3ef4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Supported configuration variables are listed in the table below. All variables
- [PostgreSQL](#postgresql)
- [CAS](#cas)
- [CONNECT](#connect)
- [Workload Orchestrator](#workload-orchestrator)
- [Miscellaneous](#miscellaneous)
- [Third-Party Tools](#third-party-tools)
- [Cert-manager](#cert-manager)
Expand Down Expand Up @@ -165,7 +166,7 @@ When V4_CFG_MANAGE_STORAGE is set to `true`, the `sas` and `pg-storage` storage
| V4M_NODE_PLACEMENT_ENABLE | Whether to enable workload node placement for viya4-monitoring-kubernetes stack | bool | false | false | | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_STORAGECLASS | StorageClass name | string | v4m | false | When V4_CFG_MANAGE_STORAGE is false, set to the name of your pre-existing StorageClass that supports ReadWriteOnce. | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_ROUTING | Which routing type to use for viya4-monitoring-kubernetes applications | string | host-based | false | Supported values: [`host-based`, `path-based`] For host-based routing, the application name is part of the host name itself `https://dashboards.host.cluster.example.com/` For path-based routing, the host name is fixed and the application name is appended as a path on the URL `https://host.cluster.example.com/dashboards` | cluster-logging, cluster-monitoring |
| V4M_CUSTOM_CONFIG_USER_DIR | Path to the viya4-monitoring-kubernetes top-level `USER_DIR` folder on the local file system. The `USER_DIR` folder can contain a top-level `user.env` file and `logging` and `monitoring` folders where your logging and monitoring `user.env` and customization yaml files are located. **NOTE**: viya4-monitoring does not validate `user.env` or yaml file content pointed to by this variable. It is recommended to use file content that has been verified ahead of time. | string | null | false | The following V4M configuration variables are ignored by viya4-monitoring when `V4M_CUSTOM_CONFIG_USER_DIR` is set: [`V4M_ROUTING`, `V4M_BASE_DOMAIN`, all `V4M_*_FQDN` variables, all `V4M_*_PASSWORD` variables] [Additional documentation](https://go.documentation.sas.com/doc/en/obsrvcdc/v_001/obsrvdply/n0wgd3ju667sa9n1adnxs7hnsqt6.htm) describing the `USER_DIR` folder is available.| cluster-logging, cluster-monitoring
| V4M_CUSTOM_CONFIG_USER_DIR | Path to the viya4-monitoring-kubernetes top-level `USER_DIR` folder on the local file system. The `USER_DIR` folder can contain a top-level `user.env` file and `logging` and `monitoring` folders where your logging and monitoring `user.env` and customization yaml files are located. **NOTE**: viya4-monitoring does not validate `user.env` or yaml file content pointed to by this variable. It is recommended to use file content that has been verified ahead of time. | string | null | false | The following V4M configuration variables are ignored by viya4-monitoring when `V4M_CUSTOM_CONFIG_USER_DIR` is set: [`V4M_ROUTING`, `V4M_BASE_DOMAIN`, all `V4M_*_FQDN` variables, all `V4M_*_PASSWORD` variables] [Additional documentation](https://go.documentation.sas.com/doc/en/obsrvcdc/v_001/obsrvdply/n0wgd3ju667sa9n1adnxs7hnsqt6.htm) describing the `USER_DIR` folder is available.| cluster-logging, cluster-monitoring |

#### Open Source Kubernetes

Expand Down Expand Up @@ -327,6 +328,16 @@ V4_CFG_POSTGRES_SERVERS:
| V4_CFG_CONNECT_ENABLE_LOADBALANCER | Set up LoadBalancer to access SAS/CONNECT | bool | false | false | | viya |
| V4_CFG_CONNECT_FQDN | FQDN that is assigned to access SAS/CONNECT | string | | false | Required when V4_CFG_TLS_MODE is not disabled and cert-manager is used to issue TLS certificates. This FQDN is added to the SAN DNS list of the issued certificates. | viya |

## Workload Orchestrator

| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- |------------:| ---: | ---: | ---: | ---: | ---: |
| V4_WORKLOAD_ORCHESTRATOR_ENABLED | Enables the [SAS Workload Orchestrator](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=dplyml0phy0dkr&docsetTarget=n08u2yg8tdkb4jn18u8zsi6yfv3d.htm#p1vo217m7ffso5n11vxwsyycw4tg) service and configures the required ClusterRole and ClusterRoleBinding used by the daemon. Setting this to false will disable SAS Workload Orchestrator service entirely | bool | true | false | This flag is only applicable for cadences 2023.08 and newer, this flag will perform no action on older cadences. | viya |

The SAS Workload Orchestrator Service is used to manage workload started on demand through the launcher service. As of cadence 2023.08 this feature is now deployed by default. The SAS Workload Orchestrator daemons require information about resources on the nodes that can be used to run jobs. In order to obtain accurate resource information, it requires a ClusterRole and a ClusterRoleBinding to the SAS Workload Orchestrator service account which will be automatically configured by this project if you set `V4_WORKLOAD_ORCHESTRATOR_ENABLED` to true.

Additional documentation for the SAS Workload Orchestrator Service can be found here in the [SAS Viya Platform Operations documentation](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=dplyml0phy0dkr&docsetTarget=n08u2yg8tdkb4jn18u8zsi6yfv3d.htm#p1vo217m7ffso5n11vxwsyycw4tg).

## Miscellaneous

| Name | Description | Type | Default | Required | Notes | Tasks |
Expand Down
3 changes: 3 additions & 0 deletions roles/vdm/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ V4_CFG_MESSAGE_BROKER_ENABLE: false
V4_CFG_MESSAGE_BROKER_HOST: null
V4_CFG_MESSAGE_BROKER_NAME: null
V4_CFG_MESSAGE_BROKER_PASSWORD: null

## SAS Workload Orchestrator
V4_WORKLOAD_ORCHESTRATOR_ENABLED: true
7 changes: 7 additions & 0 deletions roles/vdm/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@
- uninstall
- update

- name: Include Workload Orchestrator
include_tasks: workload_orchestrator.yaml
tags:
- install
- uninstall
- update

- name: Include Start Stop
include_tasks: start_stop.yaml
tags:
Expand Down
53 changes: 53 additions & 0 deletions roles/vdm/tasks/workload_orchestrator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright © 2020-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

---

- name: Workload Orchestrator - Configure SAS Workload Orchestrator Service Account
overlay_facts:
cadence_name: "{{ V4_CFG_CADENCE_NAME }}"
cadence_number: "{{ V4_CFG_CADENCE_VERSION }}"
existing: "{{ vdm_overlays }}"
add:
- { resources: overlays/sas-workload-orchestrator, min: "2023.08", vdm: false }
when:
- V4_WORKLOAD_ORCHESTRATOR_ENABLED
tags:
- install
- uninstall
- update

- name: Workload Orchestrator - Disable the SAS Workload Orchestrator Service
overlay_facts:
cadence_name: "{{ V4_CFG_CADENCE_NAME }}"
cadence_number: "{{ V4_CFG_CADENCE_VERSION }}"
existing: "{{ vdm_overlays }}"
add:
- { transformers: examples/sas-workload-orchestrator/enable-disable/sas-workload-orchestrator-disable-patch-transformer.yaml, min: "2023.08", vdm: false }
when:
- not V4_WORKLOAD_ORCHESTRATOR_ENABLED
tags:
- install
- uninstall
- update

- name: Workload Orchestrator - Remove the ClusterRoleBinding and ClusterRole
when:
- DEPLOY
- V4_WORKLOAD_ORCHESTRATOR_ENABLED
- V4_CFG_CADENCE_VERSION is version('2023.08', ">=") or V4_CFG_CADENCE_NAME|lower == "fast"
tags:
- uninstall
block:
- name: Workload Orchestrator - Remove ClusterRoleBinding
kubernetes.core.k8s:
kind: ClusterRoleBinding
name: "sas-workload-orchestrator-{{ NAMESPACE }}"
kubeconfig: "{{ KUBECONFIG }}"
state: absent
- name: Workload Orchestrator - Remove ClusterRole
kubernetes.core.k8s:
kind: ClusterRole
name: "sas-workload-orchestrator"
kubeconfig: "{{ KUBECONFIG }}"
state: absent

0 comments on commit ece3ef4

Please sign in to comment.