oncall-engine/helm/oncall/tests/extra_volume_mounts_test.yaml
Andre Buryndin d9c3d084be
feature: Hardening the Helm deployment with Redis and Postgres TLS (#3029)
# What this PR does

Short summary: this PR improves security and configuration management
for Helm deployment. Please take a look at the details below.

## Which issue(s) this PR fixes

Issues:
- Cannot explicitly define redis database (only 0 and 1 numbers are
used)
- Cannot securely use TLS for Redis (cannot set CA certificate; cannot
set client certificates)
- Cannot securely use TLS for Postgres (cannot set CA certificate;
cannot set client certificates; cannot set `verify-full` validation)
- ~~Chart option `securityContext.readOnlyRootFilesystem: true` issues
CrashLoopBack pod state~~ will be moved to new PR

## Checklist

- [x] ~~Unit, integration, and e2e (if applicable) tests updated~~ (not
required)
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

- [x] Helm tests are fixed and updated
- [x] Manually verified the features:
  - [x] postgres TLS connection with `verify-full` validation
  - [x] redis TLS connection with `cert_required` validation
  - [x] redis protocol and database number controls
  - [x] all containers properly work in read-only root filesystem
- [x] all changes are backward compatible (doesn't break old
deployments)

## Changelog

- Fixed helm tests
- Added configuration options for secure TLS communication with
dependencies like Redis, MySQL, and Postgres
- ~~Added configuration option for relocating `celerybeat` database file
(read-only root filesystem issue)~~ will be moved to new PR
- Improved redis database configuration options
- Now only single redis database is used
- Added ability to mount custom volumes (with CA certificates, for
example) into Helm chart
- ~~Fixed issue with read-only root filesystem for Helm chart~~ will be
moved to new PR
- Add ability to work with Redis ACL (and AWS ElastiCache)
2023-10-03 09:25:28 -04:00

107 lines
3.4 KiB
YAML

suite: test extraVolumeMounts and extraVolumes for deployments
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
- telegram-polling/deployment.yaml
release:
name: oncall
tests:
- it: extraVolumeMounts and extraVolumes are used -> should be present in manifest
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
- telegram-polling/deployment.yaml
set:
engine:
extraVolumeMounts:
- mountPath: /mnt/postgres-tls-client
name: postgres-tls-client
extraVolumes:
- name: postgres-tls-client
secret:
secretName: postgres-tls-client
migrate:
extraVolumeMounts:
- mountPath: /mnt/redis-tls-client
name: redis-tls-client
extraVolumes:
- name: redis-tls-client
secret:
secretName: redis-tls-client
celery:
extraVolumeMounts:
- mountPath: /etc/app/settings
name: my-custom-setting
subPath: my-custom-setting.py
extraVolumes:
- name: my-custom-setting
configMap:
name: my-custom-setting
telegramPolling:
enabled: true
extraVolumeMounts:
- mountPath: /etc/app/settings
name: my-custom-setting
subPath: my-custom-setting.py
extraVolumes:
- name: my-custom-setting
configMap:
name: my-custom-setting
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /mnt/postgres-tls-client
name: postgres-tls-client
template: engine/deployment.yaml
- contains:
path: spec.template.spec.volumes
content:
name: postgres-tls-client
secret:
secretName: postgres-tls-client
template: engine/deployment.yaml
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /mnt/redis-tls-client
name: redis-tls-client
template: engine/job-migrate.yaml
- contains:
path: spec.template.spec.volumes
content:
name: redis-tls-client
secret:
secretName: redis-tls-client
template: engine/job-migrate.yaml
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /etc/app/settings
name: my-custom-setting
subPath: my-custom-setting.py
template: celery/deployment.yaml
- contains:
path: spec.template.spec.volumes
content:
name: my-custom-setting
configMap:
name: my-custom-setting
template: celery/deployment.yaml
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
mountPath: /etc/app/settings
name: my-custom-setting
subPath: my-custom-setting.py
template: telegram-polling/deployment.yaml
- contains:
path: spec.template.spec.volumes
content:
name: my-custom-setting
configMap:
name: my-custom-setting
template: telegram-polling/deployment.yaml