Skip to content

Commit

Permalink
Merge pull request #242 from sassoftware/staging
Browse files Browse the repository at this point in the history
5.0.0 - June 17, 2022
  • Loading branch information
dhoucgitter authored Jun 17, 2022
2 parents c2c084e + 22e2137 commit 7bebc13
Show file tree
Hide file tree
Showing 16 changed files with 217 additions and 34 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt update && apt upgrade -y \

FROM baseline as tool_builder
ARG kustomize_version=3.7.0
ARG kubectl_version=1.21.8
ARG kubectl_version=1.22.10

WORKDIR /build

Expand All @@ -16,12 +16,14 @@ RUN curl -sLO https://storage.googleapis.com/kubernetes-release/release/v{$kubec

# Installation
FROM baseline
ARG HELM_VERSION=3.8.1
ARG aws_cli_version=2.1.20
ARG gcp_cli_version=334.0.0

# Add extra packages
RUN apt install -y gzip wget git git-lfs jq sshpass \
&& curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash \
&& curl -ksLO https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 755 get-helm-3 \
&& ./get-helm-3 --version v$HELM_VERSION --no-sudo \
&& helm plugin install https://github.com/databus23/helm-diff \
# AWS
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${aws_cli_version}.zip" -o "awscliv2.zip" \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ For example:
/my_custom_overlay.yaml <- my custom overlay
```

The SAS Viya Customizations that are managed by viya4-deployment are located under the [templates](https://github.com/sassoftware/viya4-deployment/tree/main/roles/vdm/templates) directory. These are purposely templatized and included there since they contain a set of customizations that are common or required for a functioning Viya deployment. These particular files are configured via exposed variables that are documented within [CONFIG-VARS.md](docs/CONFIG-VARS.md) and do not need to be manually placed under `/site-config`.

#### OpenLDAP Customizations

If the embedded OpenLDAP server is enabled, it is possible to change the users and groups that will be created. The required steps are similar to other customizations:
Expand Down
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ do
done

echo "Running: ansible-playbook $OPTS $@ playbooks/${PLAYBOOK}"
exec ansible-playbook $OPTS $@ playbooks/${PLAYBOOK}
ANSIBLE_STDOUT_CALLBACK=yaml exec ansible-playbook $OPTS $@ playbooks/${PLAYBOOK}
31 changes: 16 additions & 15 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ When setting V4_CFG_MANAGE_STORAGE to true, A new storage classes will be create
| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
| V4M_VERSION | Branch or tag of [viya4-monitoring-kubernetes](https://github.com/sassoftware/viya4-monitoring-kubernetes) | string | stable | false | | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_BASE_DOMAIN | Base domain in which subdomains for elasticsearch, kibana, grafana, prometheus and alertmanager will be created | string | | false | This or the per service fqdn's must be set | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_BASE_DOMAIN | Base domain in which subdomains for search, dashboards, grafana, prometheus and alertmanager will be created | string | | false | This or the per service fqdn's must be set | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_CERT | Path to tls certificate to use for all monitoring/logging services | string | | false | Alternately you can set the per service cert | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_KEY | Path to tls key to use for all monitoring/logging services | string | | false | Alternately you can set the per service cert | cluster-logging, cluster-monitoring, viya-monitoring |
| V4M_NODE_PLACEMENT_ENABLE | Enable workload node placement for viya4-monitoring-kubernetes stack | bool | false | false | | cluster-logging, cluster-monitoring, viya-monitoring |
Expand Down Expand Up @@ -164,21 +164,22 @@ When setting V4_CFG_MANAGE_STORAGE to true, A new storage classes will be create
| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
| V4M_LOGGING_NAMESPACE | Namespace for the logging resources | string | logging | false | | cluster-logging |
| V4M_KIBANA_FQDN | FQDN to use for kibana ingress | string | kibana.<V4M_BASE_DOMAIN> | false | | cluster-logging |
| V4M_KIBANA_CERT | Path to tls certificate to use for kibana ingress | string |<V4M_CERT> | false | If both this and V4M_CERT are not set a self-signed cert will be used | cluster-logging |
| V4M_KIBANA_KEY | Path to tls key to use for kibana ingress | string | <V4M_KEY> | false | If both this and V4M_KEY are not set a self-signed cert will be used | cluster-logging |
| V4M_KIBANA_PASSWORD | Kibana admin password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| V4M_KIBANASERVER_PASSWORD | Kibana server password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| V4M_KIBANA_FQDN | FQDN to use for dashboards ingress | string | dashboards.<V4M_BASE_DOMAIN> | false | | cluster-logging |
| V4M_KIBANA_CERT | Path to tls certificate to use for dashboards ingress | string |<V4M_CERT> | false | If both this and V4M_CERT are not set a self-signed cert will be used | cluster-logging |
| V4M_KIBANA_KEY | Path to tls key to use for dashboards ingress | string | <V4M_KEY> | false | If both this and V4M_KEY are not set a self-signed cert will be used | cluster-logging |
| V4M_KIBANA_PASSWORD | Dashboards admin password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| V4M_KIBANASERVER_PASSWORD | Dashboards server password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| V4M_LOGCOLLECTOR_PASSWORD | Logcollector password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| V4M_METRICGETTER_PASSWORD | Metricgetter password | string | randomly generated | false | If not provided, a random password will be generated and written to the log output | cluster-logging |
| | | | | | | |
| V4M_ELASTICSEARCH_FQDN | FQDN to use for elasticsearch ingress | string | elasticsearch.<V4M_BASE_DOMAIN> | false | | cluster-logging |
| V4M_ELASTICSEARCH_CERT | Path to tls certificate to use for elasticsearch ingress | string |<V4M_CERT> | false | If both this and V4M_CERT are not set a self-signed cert will be used | cluster-logging |
| V4M_ELASTICSEARCH_KEY | Path to tls key to use for elasticsearch ingress | string | <V4M_KEY> | false | If both this and V4M_KEY are not set a self-signed cert will be used | cluster-logging |
| V4M_ELASTICSEARCH_FQDN | FQDN to use for search ingress | string | search.<V4M_BASE_DOMAIN> | false | | cluster-logging |
| V4M_ELASTICSEARCH_CERT | Path to tls certificate to use for search ingress | string |<V4M_CERT> | false | If both this and V4M_CERT are not set a self-signed cert will be used | cluster-logging |
| V4M_ELASTICSEARCH_KEY | Path to tls key to use for search ingress | string | <V4M_KEY> | false | If both this and V4M_KEY are not set a self-signed cert will be used | cluster-logging |
| V4M_OSD_NODEPORT_ENABLE | If you want to make OpenSearch Dashboards accessible via NodePort, set the environment variable V4M_OSD_NODEPORT_ENABLE to true. OpenSearch Dashboards will be accessible from port 31034 | bool | false | false | | cluster-logging

## TLS

Viya 4 supports 2 different types of certificate generators, Cert-manager and openssl. When using the openssl certificate generator, you must provide: V4_CFG_TLS_CERT, V4_CFG_TLS_KEY, V4_CFG_TLS_TRUSTED_CA_CERTS. Also, the openssl certificate generator cannot be used in conjunction with the viya4-monitoring-kubernetes stack.
Viya 4 supports 2 different types of certificate generators, Cert-manager and openssl. The openssl certificate generator cannot be used in conjunction with the viya4-monitoring-kubernetes stack.

| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
Expand All @@ -193,9 +194,9 @@ Viya 4 supports 2 different types of certificate generators, Cert-manager and op

Notes:

*Values can be use to configure the tls generator when V4_CFG_TLS_MODE is not set to `disabled` and one of the following conditions is met.*
*Values can be used to configure the tls generator when V4_CFG_TLS_MODE is not set to `disabled` and one of the following conditions is met.*
- V4_CFG_TLS_GENERATOR is set to `cert-manager` and no V4_CFG_TLS_CERT/V4_CFG_TLS_KEY are defined
- V4_CFG_TLS_GENERATOR is set to `openssl`
- V4_CFG_TLS_GENERATOR is set to `openssl` and no V4_CFG_TLS_CERT/V4_CFG_TLS_KEY are defined

## Postgres

Expand Down Expand Up @@ -270,7 +271,7 @@ V4_CFG_POSTGRES_SERVERS:
| V4_CFG_CLUSTER_NODE_POOL_MODE | What mode of cluster node pool to use | string | "standard" | false | [standard, minimal] | viya |
| V4_CFG_EMBEDDED_LDAP_ENABLE | Deploy openldap in the namespace for authentication | bool | false | false | [Openldap Config](../roles/vdm/templates/generators/openldap-bootstrap-config.yaml) | viya |
| V4_CFG_CONSUL_ENABLE_LOADBALANCER | Setup LB to access consul ui | bool | false | false | Consul ui port is 8500 | viya |
| V4_CFG_ELASTICSEARCH_ENABLE | Enable opendistro elasticsearch | bool | true | false | When deploying LTS less than 2020.1 or Stable less than 2020.1.2 set to false | viya |
| V4_CFG_ELASTICSEARCH_ENABLE | Enable opendistro search | bool | true | false | When deploying LTS less than 2020.1 or Stable less than 2020.1.2 set to false | viya |

## 3rd Party tools

Expand All @@ -282,7 +283,7 @@ V4_CFG_POSTGRES_SERVERS:
| CERT_MANAGER_NAMESPACE | cert-manager helm install namespace | string | cert-manager | false | | baseline |
| CERT_MANAGER_CHART_URL | cert-manager helm chart url | string | https://charts.jetstack.io/ | false | | baseline |
| CERT_MANAGER_CHART_NAME| cert-manager helm chart name | string | cert-manager| false | | baseline |
| CERT_MANAGER_CHART_VERSION | cert-manager helm chart version | string | 1.6.1 | false | | baseline |
| CERT_MANAGER_CHART_VERSION | cert-manager helm chart version | string | 1.7.2 | false | | baseline |
| CERT_MANAGER_CONFIG | cert-manager helm values | string | see [here](../roles/baseline/defaults/main.yml) | false | | baseline |

### Cluster Autoscaler
Expand All @@ -306,7 +307,7 @@ Cluster-autoscaler is currently only used for AWS EKS clusters. GCP GKE and Azur
| INGRESS_NGINX_NAMESPACE | ingress-nginx helm install namespace | string | ingress-nginx | false | | baseline |
| INGRESS_NGINX_CHART_URL | ingress-nginx helm chart url | string | https://kubernetes.github.io/ingress-nginx | false | | baseline |
| INGRESS_NGINX_CHART_NAME | ingress-nginx helm chart name | string | ingress-nginx | false | | baseline |
| INGRESS_NGINX_CHART_VERSION | ingress-nginx helm chart version | string | "" | false | If left as "" (empty string), version 3.40.0 will be used for K8s clusters whose version is <= 1.21.X and version 4.0.13 will be used for K8s clusters whose version is >= 1.22.X| baseline |
| INGRESS_NGINX_CHART_VERSION | ingress-nginx helm chart version | string | "" | false | If left as "" (empty string), version 3.40.0 will be used for K8s clusters whose version is <= 1.21.X and version 4.0.17 will be used for K8s clusters whose version is >= 1.22.X| baseline |
| INGRESS_NGINX_CONFIG | ingress-nginx helm values | string | see [here](../roles/baseline/defaults/main.yml) Altering this value will affect the cluster | false | | baseline |

### Metrics Server
Expand Down
21 changes: 21 additions & 0 deletions docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,24 @@ Example:
-e TFSTATE=$HOME/viya4-iac-aws/terraform.tfstate \
viya4-deployment --tags "baseline,viya,cluster-logging,cluster-monitoring,viya-monitoring,install" -vvv
```
## Viya4 Monitoring and Logging
### Symptom:
While deploying Viya4 to a cluster with the "cluster-logging" and "install" Ansible task tags specified, the following error message is encountered.

```bash
TASK [monitoring : cluster-logging - deploy] ********************************************************************************
fatal: [localhost]: FAILED! => changed=false
cmd: /home/user/.ansible/viya4-monitoring-kubernetes/logging/bin/deploy_logging.sh
msg: '[Errno 2] No such file or directory: b''/home/user/.ansible/viya4-monitoring-kubernetes/logging/bin/deploy_logging.sh'''
rc: 2

PLAY RECAP ******************************************************************************************************************
localhost : ok=52 changed=12 unreachable=0 failed=1 skipped=41 rescued=0 ignored=0
```

### Diagnosis:
The cluster-logging task tried to deploy an older, incompatible release of sassoftware/viya4-monitoring-kubernetes (i.e. a release earlier than version 1.2.0) using a release of sassoftware/viya4-deployment at release 5.0.0 or later.
Release 5.0.0 (and later) of sassoftware/viya4-deployment is only compatible with sassoftware/viya4-monitoring-kubernetes release 1.2.0 (and later).

### Solution:
When using sassoftware/viya4-deployment releases 5.0.0 or later, specify either the stable branch or a valid sassoftware/viya4-monitoring-kubernetes release tag of 1.2.0 or later for the value of the V4M_VERSION sassoftware/viya4-deployment variable, For more details on supported variables, refer to [CONFIG-VARS.md](./CONFIG-VARS.md)
2 changes: 1 addition & 1 deletion docs/user/Dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SOURCE | NAME | VERSION
~ | docker | any
~ | git | any
~ | kustomize | 3.7.0
~ | kubectl | 1.20 - 1.22
~ | kubectl | 1.21 - 1.23
~ | AWS IAM Authenticator | 1.18.9/2020-11-02
~ | Helm | 3
pip3 | ansible | 2.10.7
Expand Down
6 changes: 3 additions & 3 deletions roles/baseline/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CERT_MANAGER_NAME: cert-manager
CERT_MANAGER_NAMESPACE: cert-manager
CERT_MANAGER_CHART_NAME: cert-manager
CERT_MANAGER_CHART_URL: https://charts.jetstack.io/
CERT_MANAGER_CHART_VERSION: 1.6.1
CERT_MANAGER_CHART_VERSION: 1.7.2
CERT_MANAGER_CONFIG:
installCRDs: "true"
extraArgs:
Expand All @@ -35,8 +35,8 @@ ingressVersions:
k8sMinorVersionFloor:
value: 22
api:
chartVersion: 4.0.13
appVersion: 1.1.0
chartVersion: 4.0.17
appVersion: 1.1.1

## Ingress-nginx - Ingress
INGRESS_NGINX_NAME: ingress-nginx
Expand Down
7 changes: 7 additions & 0 deletions roles/common/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@
when:
- tfstate.jump_public_ip is defined
- tfstate.jump_public_ip.value|length > 0
- name: tfstate - jump server private
set_fact:
JUMP_SVR_HOST: "{{ tfstate.jump_private_ip.value }}"
when:
- tfstate.jump_private_ip is defined
- tfstate.jump_private_ip.value|length > 0
- JUMP_SVR_HOST is not defined
- name: tfstate - jump user
set_fact:
JUMP_SVR_USER: "{{ tfstate.jump_admin_username.value }}"
Expand Down
5 changes: 3 additions & 2 deletions roles/monitoring/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ V4M_NODE_PLACEMENT_ENABLE: false
V4M_BASE_DOMAIN: "{{ V4_CFG_BASE_DOMAIN }}"
V4M_CERT: null
V4M_KEY: null
V4M_KB_KNOWN_NODEPORT_ENABLE: false

V4M_LOGGING_NAMESPACE: logging
V4M_MONITORING_NAMESPACE: monitoring

V4M_KIBANA_FQDN: "kibana.{{ V4M_BASE_DOMAIN }}"
V4M_KIBANA_FQDN: "dashboards.{{ V4M_BASE_DOMAIN }}"
V4M_KIBANA_CERT: "{{ V4M_CERT }}"
V4M_KIBANA_KEY: "{{ V4M_KEY }}"
V4M_KIBANA_PASSWORD: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"
V4M_KIBANASERVER_PASSWORD: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"
V4M_LOGCOLLECTOR_PASSWORD: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"
V4M_METRICGETTER_PASSWORD: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"

V4M_ELASTICSEARCH_FQDN: "elasticsearch.{{ V4M_BASE_DOMAIN }}"
V4M_ELASTICSEARCH_FQDN: "search.{{ V4M_BASE_DOMAIN }}"
V4M_ELASTICSEARCH_CERT: "{{ V4M_CERT }}"
V4M_ELASTICSEARCH_KEY: "{{ V4M_KEY }}"

Expand Down
37 changes: 28 additions & 9 deletions roles/monitoring/tasks/cluster-logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
tags:
- install

- name: Set password facts
set_fact:
V4M_KIBANA_PASSWORD: "{{ V4M_KIBANA_PASSWORD }}"
V4M_KIBANASERVER_PASSWORD: "{{ V4M_KIBANASERVER_PASSWORD }}"
V4M_LOGCOLLECTOR_PASSWORD: "{{ V4M_LOGCOLLECTOR_PASSWORD }}"
V4M_METRICGETTER_PASSWORD: "{{ V4M_METRICGETTER_PASSWORD }}"
tags:
- install

- name: cluster-logging - save credentials
set_fact:
"{{ logging_map['secret'][item.metadata.name] }}": "{{ item.data.password|b64decode }}"
Expand All @@ -35,17 +44,27 @@
- name: cluster-logging - output credentials
debug:
msg:
- "Kibana admin - username: admin, password: {{ V4M_KIBANA_PASSWORD }}"
- "Kibana Server - username: kibanaserver, password: {{ V4M_KIBANASERVER_PASSWORD }}"
- "Log Collector - username: logcollector, password: {{ V4M_LOGCOLLECTOR_PASSWORD }}"
- "Metric Getter - username: metricgetter, password: {{ V4M_METRICGETTER_PASSWORD }}"
- "OpenSearch admin - username: admin, password: {{ V4M_KIBANA_PASSWORD }}"
- "OpenSearch Dashboards Server - username: kibanaserver, password: {{ V4M_KIBANASERVER_PASSWORD }}"
- "Log Collector - username: logcollector, password: {{ V4M_LOGCOLLECTOR_PASSWORD }}"
- "Metric Getter - username: metricgetter, password: {{ V4M_METRICGETTER_PASSWORD }}"
tags:
- install

- name: cluster-logging - opensearch user values
template:
src: "user-values-elasticsearch-opensearch.yaml"
dest: "{{ tmpdir.path }}/logging/user-values-opensearch.yaml"
mode: "0660"
tags:
- install
- update
- uninstall

- name: cluster-logging - user values
- name: cluster-logging - osd user values
template:
src: "user-values-elasticsearch-open.yaml"
dest: "{{ tmpdir.path }}/logging/user-values-elasticsearch-open.yaml"
src: "user-values-osd-opensearch.yaml"
dest: "{{ tmpdir.path }}/logging/user-values-osd.yaml"
mode: "0660"
tags:
- install
Expand All @@ -54,7 +73,7 @@

- name: cluster-logging - deploy
command:
cmd: "{{ tmpdir.path }}/viya4-monitoring-kubernetes/logging/bin/deploy_logging_open.sh"
cmd: "{{ tmpdir.path }}/viya4-monitoring-kubernetes/logging/bin/deploy_logging.sh"
environment: "{{ logging_map['env'] }}"
tags:
- install
Expand Down Expand Up @@ -108,7 +127,7 @@

- name: cluster-logging - uninstall
command:
cmd: "{{ tmpdir.path }}/viya4-monitoring-kubernetes/logging/bin/remove_logging_open.sh"
cmd: "{{ tmpdir.path }}/viya4-monitoring-kubernetes/logging/bin/remove_logging.sh"
environment: "{{ logging_map['env'] }}"
tags:
- uninstall
Expand Down
6 changes: 6 additions & 0 deletions roles/monitoring/tasks/cluster-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
- install
- update

- name: Set password fact
set_fact:
V4M_GRAFANA_PASSWORD: "{{ V4M_GRAFANA_PASSWORD }}"
tags:
- install

- name: cluster-monitoring - save credentials
set_fact:
V4M_GRAFANA_PASSWORD: "{{ monitoring_creds.resources[0].data['admin-password']|b64decode }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
persistence:
storageClass: {{ V4M_STORAGECLASS }}
ingress:
ingressClassName: nginx
annotations:
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
enabled: true
path: /
hosts:
- {{ V4M_ELASTICSEARCH_FQDN }}
tls:
- secretName: elasticsearch-ingress-tls-secret
hosts:
- {{ V4M_ELASTICSEARCH_FQDN }}
16 changes: 16 additions & 0 deletions roles/monitoring/templates/user-values-osd-opensearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ingress:
annotations:
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
enabled: true
ingressClassName: nginx
hosts:
- host: {{ V4M_KIBANA_FQDN }}
paths:
- path: /
backend:
serviceName: v4m-osd
servicePort: 443
tls:
- secretName: kibana-ingress-tls-secret
hosts:
- {{ V4M_KIBANA_FQDN }}
1 change: 1 addition & 0 deletions roles/monitoring/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ logging_map:
ES_LOGCOLLECTOR_PASSWD: "{{ V4M_LOGCOLLECTOR_PASSWORD }}"
ES_METRICGETTER_PASSWD: "{{ V4M_METRICGETTER_PASSWORD }}"
LOG_NS: "{{ V4M_LOGGING_NAMESPACE }}"
KB_KNOWN_NODEPORT_ENABLE: "{{ V4M_KB_KNOWN_NODEPORT_ENABLE }}"

monitoring_env:
USER_DIR: "{{ tmpdir.path }}"
Expand Down
Loading

0 comments on commit 7bebc13

Please sign in to comment.