diff --git a/.github/workflows/pull-request-conditionals.yaml b/.github/workflows/pull-request-conditionals.yaml deleted file mode 100644 index 91f917f2..00000000 --- a/.github/workflows/pull-request-conditionals.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Conditionals - -# This workflow is triggered on pull requests to the main branch. -on: - pull_request: - paths: - - ".github/**" - - "bundle/**" - - "values/**" - - "tasks/**" - - "tests/**" - - "tasks.yaml" - - "zarf.yaml" - -# Permissions for the GITHUB_TOKEN used by the workflow. -permissions: - id-token: write # Needed for OIDC-related operations. - contents: read # Allows reading the content of the repository. - pull-requests: read # Allows reading pull request metadata. - -# Default settings for all run commands in the workflow jobs. -defaults: - run: - shell: bash -e -o pipefail {0} # Ensures that scripts fail on error and pipefail is set. - -jobs: - run-test: - name: Test - uses: ./.github/workflows/test.yaml - secrets: inherit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3685557f..49d8af71 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,15 +1,20 @@ -name: Test package +name: Test +# This workflow is triggered on pull requests to the main branch. on: - # Manual trigger - workflow_dispatch: - - # Triggered by pull-request-conditionals.yaml - workflow_call: + pull_request: + paths: + - ".github/**" + - "bundle/**" + - "values/**" + - "tasks/**" + - "tests/**" + - "tasks.yaml" + - "zarf.yaml" # Abort prior jobs in the same workflow / PR concurrency: - group: test-${{ github.ref }}-${{ inputs.package }} + group: test-${{ github.ref }} cancel-in-progress: true permissions: @@ -17,9 +22,12 @@ permissions: jobs: test: - runs-on: "uds-ubuntu-big-boy-16-core" + runs-on: "ubuntu-latest" timeout-minutes: 20 - name: Test + name: Deploy ${{ matrix.flavor }} + strategy: + matrix: + flavor: [upstream, registry1] steps: - name: Checkout repository @@ -32,7 +40,7 @@ jobs: run: zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil - name: Create test bundle - run: uds run create-test-bundle + run: uds run create-test-bundle --set FLAVOR=${{ matrix.flavor }} - name: Setup cluster run: uds run setup-cluster @@ -43,10 +51,6 @@ jobs: - name: Test package run: uds run test-package - - name: Cleanup - if: always() - run: uds run cleanup - - name: Save logs if: always() uses: ./.github/actions/save-logs diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b04a3f88..e737ac40 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "9.3.0-uds.1" + ".": "9.3.0-uds.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index e77fc692..55cca1f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [9.3.0-uds.2](https://github.com/defenseunicorns/uds-package-mattermost/compare/v9.3.0-uds.1...v9.3.0-uds.2) (2024-01-30) + + +### Features + +* add irsa/sa auth support ([f178a54](https://github.com/defenseunicorns/uds-package-mattermost/commit/f178a5422e0bc84bb591532015df8e9a7acb0b54)) +* add irsa/sa auth support ([c3d5acb](https://github.com/defenseunicorns/uds-package-mattermost/commit/c3d5acb55e48fb4a92b62523b32ca2b90d181614)) + ## [9.3.0-uds.1](https://github.com/defenseunicorns/uds-package-mattermost/compare/v9.3.0-uds.0...v9.3.0-uds.1) (2024-01-29) diff --git a/README.md b/README.md index b67950d4..59da501b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,46 @@ # uds-package-mattermost UDS Mattermost Zarf Package + +## Dependencies + +Mattermost requires two dependencies, postgres and s3 compatible object storage. Wiring Mattermost to your dependencies is done via secrets created in the `mattermost` namespace. + +### Postgres + +You should create a secret named `mattermost-postgres` with a single key containing the DB connection string like the following: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: mattermost-postgres + namespace: mattermost +type: kubernetes.io/opaque +stringData: + DB_CONNECTION_STRING: "postgres://username:password@hostname:port/dbname?postgresoptions" +``` + +### S3 Compatible Object Storage + +You should create a secret named `mattermost-object-store` with a number of keys matching the below: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: mattermost-object-store + namespace: mattermost +type: kubernetes.io/opaque +stringData: + secure_connection: # Typically false for insecure connections like MinIO + access_key: + secret_key: + region: + bucket: + endpoint: +``` + +To use IRSA make sure to set the two keys to empty strings and add the appropriate annotations to the service account via `serviceAccount.annotations` (override in a UDS Bundle). + +TODO: Figure out if this setup works and a better way to handle the keys... diff --git a/bundle/uds-bundle.yaml b/bundle/uds-bundle.yaml index 868ba736..5414990a 100644 --- a/bundle/uds-bundle.yaml +++ b/bundle/uds-bundle.yaml @@ -3,7 +3,7 @@ metadata: name: mattermost-test description: A UDS bundle for deploying Mattermost and it's dependencies on a development cluster # x-release-please-start-version - version: 9.3.0-uds.1 + version: 9.3.0-uds.2 # x-release-please-end packages: @@ -22,5 +22,5 @@ packages: - name: mattermost path: ../ # x-release-please-start-version - ref: 9.3.0-uds.1 + ref: 9.3.0-uds.2 # x-release-please-end diff --git a/src/dev-secrets/minio-secret.yaml b/src/dev-secrets/minio-secret.yaml index ff4f1153..a0083af9 100644 --- a/src/dev-secrets/minio-secret.yaml +++ b/src/dev-secrets/minio-secret.yaml @@ -1,4 +1,3 @@ -# Source: bigbang/templates/mattermost/secret-objectstore.yaml apiVersion: v1 kind: Secret metadata: @@ -6,8 +5,9 @@ metadata: namespace: mattermost type: kubernetes.io/opaque stringData: - MM_FILESETTINGS_AMAZONS3SSL: "false" - MM_FILESETTINGS_AMAZONS3ACCESSKEYID: ###ZARF_VAR_ACCESS_KEY### - MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY: ###ZARF_VAR_SECRET_KEY### - MM_FILESETTINGS_AMAZONS3BUCKET: "uds-mattermost-dev" - MM_FILESETTINGS_AMAZONS3ENDPOINT: "minio.dev-minio.svc.cluster.local:9000" + secure_connection: "false" + access_key: ###ZARF_VAR_ACCESS_KEY### + secret_key: ###ZARF_VAR_SECRET_KEY### + region: "minio" + bucket: "uds-mattermost-dev" + endpoint: "minio.dev-minio.svc.cluster.local:9000" diff --git a/src/dev-secrets/postgres-secret.yaml b/src/dev-secrets/postgres-secret.yaml index 17695171..03635ad7 100644 --- a/src/dev-secrets/postgres-secret.yaml +++ b/src/dev-secrets/postgres-secret.yaml @@ -5,4 +5,4 @@ metadata: namespace: mattermost type: kubernetes.io/opaque stringData: - DB_CONNECTION_STRING: "postgres://mattermost:###ZARF_VAR_POSTGRES_DB_PASSWORD###@postgresql.dev-postgres.svc.cluster.local:5432/mattermostdb?connect_timeout=10&sslmode=disable" + db_connection_string: "postgres://mattermost:###ZARF_VAR_POSTGRES_DB_PASSWORD###@postgresql.dev-postgres.svc.cluster.local:5432/mattermostdb?connect_timeout=10&sslmode=disable" diff --git a/tasks.yaml b/tasks.yaml index 09104a07..3c216209 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -34,7 +34,6 @@ tasks: - name: test-package actions: - - task: test:health-check - task: test:ingress - name: cleanup diff --git a/tasks/publish.yaml b/tasks/publish.yaml index 05c3c2d1..f3ffa4e4 100644 --- a/tasks/publish.yaml +++ b/tasks/publish.yaml @@ -5,7 +5,7 @@ variables: - name: VERSION description: The version of the package to build # x-release-please-start-version - default: "9.3.0-uds.1" + default: "9.3.0-uds.2" # x-release-please-end tasks: diff --git a/tasks/test.yaml b/tasks/test.yaml index bd457db2..6fc0bf48 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -1,20 +1,4 @@ tasks: - - name: health-check - actions: - - description: Mattermost Operator Health Check - wait: - cluster: - kind: Deployment - name: mattermost-operator - namespace: mattermost-operator - - - description: Mattermost Health Check - wait: - cluster: - kind: Deployment - name: mattermost - namespace: mattermost - - name: ingress actions: - description: Mattermost UI Health Check diff --git a/values/values.yaml b/values/values.yaml index 852d640e..5d619552 100644 --- a/values/values.yaml +++ b/values/values.yaml @@ -59,27 +59,32 @@ mattermostApp: - name: MM_FILESETTINGS_AMAZONS3SSL valueFrom: secretKeyRef: - key: MM_FILESETTINGS_AMAZONS3SSL + key: secure_connection name: "mattermost-object-store" - name: MM_FILESETTINGS_AMAZONS3ACCESSKEYID valueFrom: secretKeyRef: - key: MM_FILESETTINGS_AMAZONS3ACCESSKEYID + key: access_key name: "mattermost-object-store" - name: MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY valueFrom: secretKeyRef: - key: MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY + key: secret_key name: "mattermost-object-store" - name: MM_FILESETTINGS_AMAZONS3BUCKET valueFrom: secretKeyRef: - key: MM_FILESETTINGS_AMAZONS3BUCKET + key: bucket name: "mattermost-object-store" - name: MM_FILESETTINGS_AMAZONS3ENDPOINT valueFrom: secretKeyRef: - key: MM_FILESETTINGS_AMAZONS3ENDPOINT + key: endpoint + name: "mattermost-object-store" + - name: MM_FILESETTINGS_AMAZONS3REGION + valueFrom: + secretKeyRef: + key: region name: "mattermost-object-store" securityContext: runAsUser: 2000 @@ -99,7 +104,7 @@ global: useInternal: false existingDatabaseSecret: name: mattermost-postgres - key: DB_CONNECTION_STRING + key: db_connection_string # The job server is only necessary on multi-node/enterprise clusters # https://docs.mattermost.com/scale/high-availability-cluster.html#job-server # It also will error due to its init container being blocked by Istio mTLS diff --git a/version.txt b/version.txt index 57ec6892..2c1ddafc 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -9.3.0-uds.1 +9.3.0-uds.2 diff --git a/zarf.yaml b/zarf.yaml index bdd54b4d..80fba314 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -4,7 +4,7 @@ metadata: name: mattermost description: "UDS Mattermost Package" # x-release-please-start-version - version: "9.3.0-uds.1" + version: "9.3.0-uds.2" # x-release-please-end architecture: amd64 @@ -12,10 +12,6 @@ variables: - name: MATTERMOST_ENTERPRISE_LICENSE default: "" autoIndent: true - - name: MATTERMOST_BUCKET_SUFFIX - default: "" - - name: MATTERMOST_FILE_STORE_ENDPOINT - default: "minio" - name: MATTERMOST_SSO_ENABLED default: "false" - name: MATTERMOST_SSO_CLIENT_ID