diff --git a/charts/mastodon/Chart.yaml b/charts/mastodon/Chart.yaml index 78803fc649d86dad0255e4dd45d44caf06f70719..dafd33919d37c2b1c2bcb18b79af9d0758f250f4 100644 --- a/charts/mastodon/Chart.yaml +++ b/charts/mastodon/Chart.yaml @@ -11,7 +11,7 @@ sources: - https://git.shivering-isles.com/shivering-isles/infrastructure-gitops/-/tree/main/charts/mastodon type: application -version: 5.1.2 +version: 6.0.0 # renovate: image=ghcr.io/mastodon/mastodon appVersion: v4.1.1 diff --git a/charts/mastodon/README.md b/charts/mastodon/README.md index cf18bd53d04d94bf9167cc0816fac0f6f1e6b294..d8b55b063ddd1a66084fcddcae3228c17ee6378f 100644 --- a/charts/mastodon/README.md +++ b/charts/mastodon/README.md @@ -1,6 +1,6 @@ # mastodon -   +   Mastodon is a free, open-source social network server based on ActivityPub. @@ -115,7 +115,7 @@ Mastodon is a free, open-source social network server based on ActivityPub. | postgresql.auth.password | string | `""` | | | postgresql.auth.username | string | `"mastodon"` | | | postgresql.enabled | bool | `true` | disable if you want to use an existing db; in which case the values below must match those of that external postgres instance | -| redis.password | string | `""` | you must set a password; the password generated by the redis chart will be rotated on each upgrade: | +| redis.auth.password | string | `""` | you must set a password; the password generated by the redis chart will be rotated on each upgrade: | | resources | object | `{}` | Default resources for all Deployments and jobs unless overwritten | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | diff --git a/charts/mastodon/tests/80_subchart_elasticsearch_test.yaml b/charts/mastodon/tests/80_subchart_elasticsearch_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6368b8005570d2d2cd8202d34e1c18bbf099de65 --- /dev/null +++ b/charts/mastodon/tests/80_subchart_elasticsearch_test.yaml @@ -0,0 +1,39 @@ +suite: elasticsearch +templates: + - charts/elasticsearch/templates/master/statefulset.yaml + - configmap-env.yaml + - deployment-sidekiq.yaml + - deployment-streaming.yaml + - deployment-web.yaml + - secrets.yaml +values: + - mocks/dev.yaml +chart: + version: 1.2.3 + appVersion: 4.5.6 +capabilities: + apiVersions: + - networking.k8s.io/v1/Ingress +tests: + - it: should have correct hostname + asserts: + - equal: + path: data.ES_HOST + value: RELEASE-NAME-elasticsearch-master-hl + template: configmap-env.yaml + - equal: + path: spec.serviceName + value: RELEASE-NAME-elasticsearch-master-hl + template: charts/elasticsearch/templates/master/statefulset.yaml + - it: should use port 9200 + asserts: + - equal: + path: data.ES_PORT + value: "9200" + template: configmap-env.yaml + - contains: + path: spec.template.spec.containers[0].ports + content: + name: rest-api + containerPort: 9200 + template: charts/elasticsearch/templates/master/statefulset.yaml \ No newline at end of file diff --git a/charts/mastodon/tests/80_subchart_postgresql_test.yaml b/charts/mastodon/tests/80_subchart_postgresql_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8fd543bfb3725ae51d0304b37745d94d9e490bbc --- /dev/null +++ b/charts/mastodon/tests/80_subchart_postgresql_test.yaml @@ -0,0 +1,142 @@ +suite: postgresql +templates: + - charts/postgresql/templates/primary/svc.yaml + - charts/postgresql/templates/secrets.yaml + - charts/postgresql/templates/primary/statefulset.yaml + - configmap-env.yaml + - deployment-sidekiq.yaml + - deployment-streaming.yaml + - deployment-web.yaml + - secrets.yaml +values: + - mocks/dev.yaml +chart: + version: 1.2.3 + appVersion: 4.5.6 +capabilities: + apiVersions: + - networking.k8s.io/v1/Ingress +tests: + - it: should match service name and configured host + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-postgresql + template: charts/postgresql/templates/primary/svc.yaml + - equal: + path: data.DB_HOST + value: RELEASE-NAME-postgresql + template: configmap-env.yaml + - it: should match password secret names and structure + asserts: + - isNotEmpty: + path: data.password + template: charts/postgresql/templates/secrets.yaml + documentIndex: 0 + - equal: + path: metadata.name + value: RELEASE-NAME-postgresql + template: charts/postgresql/templates/secrets.yaml + documentIndex: 0 + - contains: + path: spec.template.spec.containers[0].env + content: + name: "DB_PASS" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-postgresql + key: password + template: deployment-web.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: "DB_PASS" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-postgresql + key: password + template: deployment-streaming.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: "DB_PASS" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-postgresql + key: password + template: deployment-sidekiq.yaml + - it: should have correct default the database username + asserts: + - equal: + path: data.DB_USER + value: mastodon + template: configmap-env.yaml + - equal: + path: data.DB_USER + value: mastodon + template: configmap-env.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: POSTGRES_USER + value: "mastodon" + template: charts/postgresql/templates/primary/statefulset.yaml + - it: should allow to change the database username + set: + postgresql: + auth: + username: test + asserts: + - equal: + path: data.DB_USER + value: test + template: configmap-env.yaml + - equal: + path: data.DB_USER + value: test + template: configmap-env.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: POSTGRES_USER + value: "test" + template: charts/postgresql/templates/primary/statefulset.yaml + - it: should allow to control password changes + set: + postgresql: + auth: + password: test + asserts: + - equal: + path: data.password + value: dGVzdA== + template: charts/postgresql/templates/secrets.yaml + documentIndex: 0 + - it: should use the expected database name + asserts: + - equal: + path: data.DB_NAME + value: mastodon_production + template: configmap-env.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: POSTGRES_DB + value: "mastodon_production" + template: charts/postgresql/templates/primary/statefulset.yaml + - it: should allow to change the database name + set: + postgresql: + auth: + database: test + asserts: + - equal: + path: data.DB_NAME + value: test + template: configmap-env.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: POSTGRES_DB + value: "test" + template: charts/postgresql/templates/primary/statefulset.yaml \ No newline at end of file diff --git a/charts/mastodon/tests/80_subchart_redis_test.yaml b/charts/mastodon/tests/80_subchart_redis_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..91ff108e0f11cfd4ba6c516e95d16bb5c8fd6fd4 --- /dev/null +++ b/charts/mastodon/tests/80_subchart_redis_test.yaml @@ -0,0 +1,77 @@ +suite: redis +templates: + - charts/redis/templates/master/service.yaml + - charts/redis/templates/secret.yaml + - configmap-env.yaml + - deployment-sidekiq.yaml + - deployment-streaming.yaml + - deployment-web.yaml + - secrets.yaml +values: + - mocks/dev.yaml +chart: + version: 1.2.3 + appVersion: 4.5.6 +capabilities: + apiVersions: + - networking.k8s.io/v1/Ingress +tests: + - it: should match service name and configured host + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-redis-master + template: charts/redis/templates/master/service.yaml + - equal: + path: data.REDIS_HOST + value: RELEASE-NAME-redis-master + template: configmap-env.yaml + - it: should match password secret names and structure + asserts: + - isNotEmpty: + path: data.redis-password + template: charts/redis/templates/secret.yaml + documentIndex: 0 + - equal: + path: metadata.name + value: RELEASE-NAME-redis + template: charts/redis/templates/secret.yaml + documentIndex: 0 + - contains: + path: spec.template.spec.containers[0].env + content: + name: "REDIS_PASSWORD" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-redis + key: redis-password + template: deployment-web.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: "REDIS_PASSWORD" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-redis + key: redis-password + template: deployment-streaming.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: "REDIS_PASSWORD" + valueFrom: + secretKeyRef: + name: RELEASE-NAME-redis + key: redis-password + template: deployment-sidekiq.yaml + - it: should allow to control password changes + set: + redis: + auth: + password: test + asserts: + - equal: + path: data.redis-password + value: dGVzdA== + template: charts/redis/templates/secret.yaml + documentIndex: 0 \ No newline at end of file diff --git a/charts/mastodon/values.yaml b/charts/mastodon/values.yaml index 067f5848a327cf3a3e434f6f7d1eab921a60448b..25ed14865b2676a6e3396d87371ff31e31c72d63 100644 --- a/charts/mastodon/values.yaml +++ b/charts/mastodon/values.yaml @@ -262,12 +262,12 @@ postgresql: # https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters redis: - # -- you must set a password; the password generated by the redis chart will be - # rotated on each upgrade: - password: "" - # you can also specify the name of an existing Secret - # with a key of redis-password set to the password you want - # auth: + auth: + # -- you must set a password; the password generated by the redis chart will be + # rotated on each upgrade: + password: "" + # you can also specify the name of an existing Secret + # with a key of redis-password set to the password you want # existingSecret: "" # @ignored