sassoftware / viya4-deployment

This project contains Ansible code that creates a baseline in an existing Kubernetes environment for use with the SAS Viya Platform, generates the manifest for an order, and then can also deploy that order into the Kubernetes environment specified.
Apache License 2.0
70 stars 64 forks source link

feat: (IAC-180) Add V4M_CUSTOM_CONFIG_USER_DIR config var for ops4viya logging & monitoring custom configurations #429

Closed dhoucgitter closed 1 year ago

dhoucgitter commented 1 year ago

Changes

Allow DAC users to provide an ops4viya $USER_DIR folder containing user.env and customization yaml file content to sufficiently configure cluster-logging and/or cluster-monitoring applications provided by the viya4-monitoring-kubernetes project.

Shown below is an example of supplying the additional V4M_CUSTOM_CONFIG_USER_DIR configuration variable value when invoking DAC using the docker container to install cluster-logging and cluster-monitoring. See the updated DockerVolumeMounts.md file in the dev branch for instructions on expressing the V4M_CUSTOM_CONFIG_USER_DIR value when running DAC using the docker container, it describes what is shown below.

The NOTE below has been added to the variable's CONFIG-VARS.md entry to reinforce that DAC does not validate any of the file content provided under the V4M_CUSTOM_CONFIG_USER_DIR folder. The expectation is that file content has already been verified as working with cluster-logging and/or cluster-monitoring.

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.

For this example, the USER_DIR content is located on the local file system at $HOME/custom_cfg and appears on line 5 of the multi-line docker run command below.

docker run --rm --group-add root --user "$(id -u):$(id -g)" --volume "$HOME"/deployments:/data \
--volume <desired_path>:/config/config \
--volume <desired_path>:/config/tfstate \
--volume <desired_path>:/config/jump_svr_private_key \
--volume "$HOME"/custom_cfg:/config/v4m_custom_config_user_dir \
<viya4-deployment docker container> --tags "cluster-logging,cluster-monitoring,install"

The local filesystem content at $HOME/custom_cfg used for a test deployment looked like this:

$HOME/custom_cfg
├── logging
│   ├── user-values-fluent-bit-opensearch.yaml
│   ├── user-values-opensearch.yaml
│   ├── user-values-osd.yaml
│   └── user.env
├── monitoring
│   ├── user-values-prom-operator.yaml
│   └── user.env
└── user.env

Testing

Scenario Method V4M_VERSION V4M_CUSTOM_CONFIG_USER_DIR tasks Notes
1 docker Stable not provided (default=null) cluster-logging,cluster-monitoring,install Successful login to dashboards.\<fqdn> with data showing in Log Message with Volume dashboard, good login to search.\<fqdn>, login to grafana.\<fqdn> with Prometheus data visible from k8s cluster dashboard
2 docker Stable not provided (default=null) cluster-logging,cluster-monitoring,uninstall Successful uninstall of both cluster-logging & cluster-monitoring applications
3 ansible Stable $HOME/custom_cfg cluster-logging,cluster-monitoring,install All pods in logging and monitoring namespaces were successfully deployed, all log/mon pods were stable w/ Running status
4 docker Stable $HOME/custom_cfg cluster-logging,cluster-monitoring,install Successful login to dashboards.\<fqdn> with data showing in Log Message with Volume dashboard, good login to search.\<fqdn>, good login to grafana.\<fqdn>, Prometheus data is visible from k8s cluster dashboard

For background, links to the documented process for providing and copying the sample yaml files and user.env files along with a $USER_DIR when deploying the Viya Monitoring for Kubernetes project without DAC are here: