Skip to content

Commit

Permalink
add support for data server operator (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
NormJohnIV authored Aug 18, 2021
1 parent fc1534d commit 84c2630
Show file tree
Hide file tree
Showing 50 changed files with 688 additions and 282 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,8 @@ This following information is parsed from the integration:
- JUMP_SVR_HOST
- JUMP_SVR_USER
- JUMP_SVR_RWX_FILESTORE_PATH
- Postgres (When V4_CFG_POSTGRES_TYPE is set to external)
- V4_CFG_POSTGRES_ADMIN_LOGIN
- V4_CFG_POSTGRES_PASSWORD
- V4_CFG_POSTGRES_FQDN
- V4_CFG_POSTGRES_CONNECTION_NAME
- V4_CFG_POSTGRES_SERVICE_ACCOUNT
- V4_CFG_POSTGRES_SSL_ENFORCEMENT
- Postgres
- V4_CFG_POSTGRES_SERVERS (if postgres deployed)
- Cluster
- KUBECONFIG
- V4_CFG_CLUSTER_NODE_POOL_MODE
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ display_skipped_hosts = False
hash_behaviour=merge
library = /usr/share/ansible:./plugins/modules
lookup_plugins = ./plugins/lookup
action_plugins = ./plugins/action
action_plugins = ./plugins/action
52 changes: 39 additions & 13 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Supported configuration variables are listed in the table below. All variables
- [TLS](#tls)
- [Cert-manager](#cert-manager)
- [Postgres](#postgres)
- [External Postgres](#external-postgres)
- [CAS](#cas)
- [CONNECT](#connect)
- [Miscellaneous](#miscellaneous)
Expand Down Expand Up @@ -191,22 +190,49 @@ When setting V4_CFG_TLS_MODE to a value other than "disabled" and no V4_CFG_TLS_

## Postgres

| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
| V4_CFG_POSTGRES_TYPE | Postgres installation type | string | | true | [internal,external] | viya |
Postgres servers can be defined with the postgres_servers variable which is a map of objects. The variable has the following format:

```bash
V4_CFG_POSTGRES_SERVERS:
default: {}
...
```

### External Postgres
**NOTE**: the `default` elements is always required . This will be the default server. Below is the list of parameters each element can contain.

| Name | Description | Type | Default | Required | Notes | Tasks |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
| V4_CFG_POSTGRES_ADMIN_LOGIN | Existing postgres username | string | | true | | viya |
| V4_CFG_POSTGRES_PASSWORD | Existing postgres password | string | | true | | viya |
| V4_CFG_POSTGRES_FQDN | Existing postgres ip/fqdn | string | | true | | viya |
| V4_CFG_POSTGRES_PORT | Existing postgres port | string | 5432 | false | | viya |
| V4_CFG_POSTGRES_DATABASE | Existing postgres database name | string | "SharedServices" | false | | viya |
| V4_CFG_POSTGRES_SSL_ENFORCEMENT | Require ssl connection to existing postgres | bool | false | false | Ignored on GCP when using cloud sql | viya |
| V4_CFG_POSTGRES_CONNECTION_NAME | Existing postgres database connection name | string | | false | See [ansible cloud authentication](user/AnsibleCloudAuthentication.md) | viya |
| V4_CFG_POSTGRES_SERVICE_ACCOUNT | Existing service account for postgres connectivity | string | | false | See [ansible cloud authentication](user/AnsibleCloudAuthentication.md) | viya |
| internal | Whether the database is internal or external | bool | | true | All servers must but internal or all must be external | viya |
| database | Database name | string | Database server role | false | Default database name for default server is SharedServices | viya |
| admin | External postgres username | string | | false | Required for external postgres servers | viya |
| password | External postgres password | string | | false | Required for external postgres servers | viya |
| fqdn | External postgres ip/fqdn | string | | false | Required for external postgres servers | viya |
| server_port | External postgres port | string | 5432 | false | | viya |
| ssl_enforcement_enabled | Require ssl connection to external postgres | bool | | false | Required for external postgres servers. Ignored on GCP when using cloud sql | viya |
| connection_name | External postgres database connection name | string | | false | Required for using cloud-sql-proxy on gcp. See [ansible cloud authentication](user/AnsibleCloudAuthentication.md) | viya |
| service_account | External service account for postgres connectivity | string | | false | Required for using cloud-sql-proxy on gcp. See [ansible cloud authentication](user/AnsibleCloudAuthentication.md) | viya |

Example:

```bash
V4_CFG_POSTGRES_SERVERS:
default:
internal: false
admin: pgadmin
password: "password"
fqdn: mydbserver.local
server_port: 5432
ssl_enforcement_enabled: true
database: SharedServices
other_db:
internal: false
admin: pgadmin
password: "password"
fqdn: 10.10.10.10
server_port: 5432
ssl_enforcement_enabled: true
database: OtherDB
```

## CAS

Expand Down
1 change: 0 additions & 1 deletion examples/ansible-vars-iac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ V4_CFG_INGRESS_FQDN: <desired_fqdn>
V4_CFG_TLS_MODE: "full-stack" # [full-stack|front-door|disabled]

## Postgres
V4_CFG_POSTGRES_TYPE: external #[internal|external]

## LDAP
V4_CFG_EMBEDDED_LDAP_ENABLE: true
Expand Down
15 changes: 9 additions & 6 deletions examples/ansible-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ V4_CFG_INGRESS_FQDN: <desired_fqdn>
V4_CFG_TLS_MODE: "full-stack" # [full-stack|front-door|disabled]

## Postgres
V4_CFG_POSTGRES_TYPE: external
V4_CFG_POSTGRES_ADMIN_LOGIN: <existing_pg_user>
V4_CFG_POSTGRES_PASSWORD: <existing_pg_password>
V4_CFG_POSTGRES_FQDN: <existing_pg_fqdn>
V4_CFG_POSTGRES_PORT: 5432
V4_CFG_POSTGRES_SERVERS:
default:
internal: false
admin: <existing_pg_user>
password: <existing_pg_password>
fqdn: <existing_pg_fqdn>
ssl_enforcement_enabled: true
database: <desired_database>

## LDAP
V4_CFG_EMBEDDED_LDAP_ENABLE: true
Expand All @@ -50,4 +53,4 @@ V4_CFG_CONNECT_ENABLE_LOADBALANCER: false

## Monitoring and Logging
## uncomment and update the below values when deploying the viya4-monitoring-kubernetes stack
#V4M_BASE_DOMAIN: <base_domain>
#V4M_BASE_DOMAIN: <base_domain>
7 changes: 4 additions & 3 deletions playbooks/playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
tags:
- install
- uninstall
- upgrade
- update
- name: common role
include_role:
name: common
public: yes
tags:
- install
- uninstall
- upgrade
- update
- name: jump-server role
include_role:
name: jump-server
Expand Down Expand Up @@ -46,6 +46,7 @@
- name: monitoring role - namespace
include_role:
name: monitoring
tasks_from: viya-monitoring
tags:
- viya-monitoring
- name: Delete tmpdir
Expand All @@ -55,4 +56,4 @@
tags:
- install
- uninstall
- upgrade
- update
2 changes: 2 additions & 0 deletions requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
collections:
- name: community.kubernetes
version: 1.2.1
- name: ansible.utils
version: 2.3.0
22 changes: 22 additions & 0 deletions roles/baseline/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ V4_CFG_TLS_MODE: "full-stack" # other valid values are front-door and disabled
V4_CFG_RWX_FILESTORE_ENDPOINT: /export
V4_CFG_INGRESS_TYPE: ingress

PRIVATE_CLUSTER_ENABLE: false

## Cert-manager
CERT_MANAGER_NAME: cert-manager
CERT_MANAGER_NAMESPACE: cert-manager
Expand Down Expand Up @@ -34,6 +36,8 @@ INGRESS_NGINX_CONFIG:
externalTrafficPolicy: Local
sessionAffinity: None
loadBalancerSourceRanges: "{{ LOADBALANCER_SOURCE_RANGES |default(['0.0.0.0/0'], -1) }}"
annotation:

config:
use-forwarded-headers: "true"
tcp: {}
Expand Down Expand Up @@ -91,3 +95,21 @@ CLUSTER_AUTOSCALER_CONFIG:
name: cluster-autoscaler
annotations:
"eks.amazonaws.com/role-arn": "{{ CLUSTER_AUTOSCALER_ACCOUNT }}"

private_cluster:
aws:
controller:
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-type: nlb
azure:
controller:
service:
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
gcp:
controller:
service:
annotations:
networking.gke.io/load-balancer-type: "Internal"
2 changes: 1 addition & 1 deletion roles/baseline/tasks/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
wait: true
tags:
- install
- upgrade
- update

- name: Remove cert-manager
community.kubernetes.helm:
Expand Down
2 changes: 1 addition & 1 deletion roles/baseline/tasks/cluster-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wait: true
tags:
- install
- upgrade
- update

- name: Remove cluster-autoscaler
community.kubernetes.helm:
Expand Down
2 changes: 1 addition & 1 deletion roles/baseline/tasks/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
wait: true
tags:
- install
- upgrade
- update

- name: Remove contour
community.kubernetes.helm:
Expand Down
11 changes: 10 additions & 1 deletion roles/baseline/tasks/ingress-nginx.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
---
- set_fact:
INGRESS_NGINX_CONFIG: "{{ INGRESS_NGINX_CONFIG |combine(private_cluster[PROVIDER], recursive=True)}}"
when:
- PRIVATE_CLUSTER_ENABLE
- PROVIDER in private_cluster
tags:
- install
- update

- name: Deploy ingress-nginx
community.kubernetes.helm:
name: "{{ INGRESS_NGINX_NAME }}"
Expand All @@ -12,7 +21,7 @@
wait: true
tags:
- install
- upgrade
- update

- name: Remove ingress-nginx
community.kubernetes.helm:
Expand Down
4 changes: 2 additions & 2 deletions roles/baseline/tasks/metrics-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
register: metrics_service
tags:
- install
- upgrade
- update
- uninstall

- name: Deploy metrics-server
Expand All @@ -24,7 +24,7 @@
wait: true
tags:
- install
- upgrade
- update
when:
- (metrics_service.resources | length) == 0

Expand Down
8 changes: 4 additions & 4 deletions roles/baseline/tasks/nfs-subdir-external-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tags:
- install
- uninstall
- upgrade
- update

- name: Remove deprecated efs-provisioner
community.kubernetes.helm:
Expand All @@ -19,7 +19,7 @@
tags:
- install
- uninstall
- upgrade
- update

- name: Remove deprecated efs-provisioner namespace
community.kubernetes.k8s:
Expand All @@ -31,7 +31,7 @@
tags:
- install
- uninstall
- upgrade
- update

- name: Deploy nfs-subdir-external-provisioner
community.kubernetes.helm:
Expand All @@ -46,7 +46,7 @@
wait: true
tags:
- install
- upgrade
- update

- name: Remove nfs-subdir-external-provisioner
community.kubernetes.helm:
Expand Down
2 changes: 2 additions & 0 deletions roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
V4_CFG_POSTGRES_SERVERS:
default: {}
Loading

0 comments on commit 84c2630

Please sign in to comment.