From 43ad36eb2ce81d6fe6180f4d41d0e0a1c39ad5e6 Mon Sep 17 00:00:00 2001 From: Mike Pond <32133001+P0NDER0SA@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:23:01 -0500 Subject: [PATCH] Helm Migration for Staging (#3186) * turning on targetgroup bindings and turning on staging for helmfile * adding dummy services back to celery so that our metrics can read them * just makign this consistent for rollout * fixing celery hpa * removing kustomize apply ins staging workflow * turning off kustomize deployments for our helm migrated components on dev, sandbox and staging * fixing xray url * cleaning up env vars thing * removing syntax check since helmfile auto does it * switch to helmfile sync * xray url fix again --------- Co-authored-by: Ben Larabie --- .../workflows/helmfile_production_apply.yaml | 2 +- .github/workflows/helmfile_staging_apply.yaml | 2 +- .github/workflows/syntax_check.yaml | 30 ------ .github/workflows/test_env_vars.yaml | 35 +----- env/dev/kustomization.yaml | 100 +++++++++--------- env/sandbox/kustomization.yaml | 98 ++++++++--------- env/staging/kustomization.yaml | 96 ++++++++--------- .../charts/notify-celery/templates/hpa.yaml | 2 +- .../notify-celery/templates/service.yaml | 22 ++++ helmfile/charts/notify-celery/values.yaml | 20 +++- helmfile/helmfile.yaml | 2 +- helmfile/overrides/notify/admin.yaml.gotmpl | 2 +- helmfile/overrides/notify/api.yaml.gotmpl | 2 +- .../notify/document-download.yaml.gotmpl | 2 +- .../notify/documentation.yaml.gotmpl | 2 +- 15 files changed, 199 insertions(+), 218 deletions(-) delete mode 100644 .github/workflows/syntax_check.yaml create mode 100644 helmfile/charts/notify-celery/templates/service.yaml diff --git a/.github/workflows/helmfile_production_apply.yaml b/.github/workflows/helmfile_production_apply.yaml index cfe8de348..e74a08815 100644 --- a/.github/workflows/helmfile_production_apply.yaml +++ b/.github/workflows/helmfile_production_apply.yaml @@ -84,7 +84,7 @@ jobs: id: helmfile_apply run: | pushd helmfile - helmfile --environment production apply + helmfile --environment production sync popd - name: Notify Slack channel if this job failed diff --git a/.github/workflows/helmfile_staging_apply.yaml b/.github/workflows/helmfile_staging_apply.yaml index 354a2a760..aeb336160 100644 --- a/.github/workflows/helmfile_staging_apply.yaml +++ b/.github/workflows/helmfile_staging_apply.yaml @@ -82,7 +82,7 @@ jobs: id: helmfile_apply run: | pushd helmfile - helmfile --environment staging apply + helmfile --environment staging sync popd - name: Notify Slack channel if this job failed diff --git a/.github/workflows/syntax_check.yaml b/.github/workflows/syntax_check.yaml deleted file mode 100644 index cd82011bc..000000000 --- a/.github/workflows/syntax_check.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Testing Staging Manifest - -on: - - pull_request - -jobs: - testing_manifest: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - # I'm cheating and using this action to install kubectl - - name: Setup helmfile - uses: mamezou-tech/setup-helmfile@03233e1cd9b19b2ba320e431f7bcc0618db4248d # v2.0.0 - with: - install-kubectl: yes - install-helm: yes - - - name: Add fake .env - run: | - cp env.example env/staging/.env - - - name: Test staging manifest build - uses: ./.github/actions/test-manifest - if: always() - with: - build-target: staging-debug - echo-manifest: true \ No newline at end of file diff --git a/.github/workflows/test_env_vars.yaml b/.github/workflows/test_env_vars.yaml index 56024d0dc..ea235652b 100644 --- a/.github/workflows/test_env_vars.yaml +++ b/.github/workflows/test_env_vars.yaml @@ -4,9 +4,13 @@ on: pull_request: branches: - main + paths: + - "VERSION" push: branches: - main + paths: + - "VERSION" defaults: run: @@ -32,20 +36,6 @@ jobs: aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} aws-region: ca-central-1 - - name: Get staging env var keys - run: | - make decrypt-staging - ENV_KEYS_STAGING="$(make env-keys-staging)" - echo "::add-mask::$ENV_KEYS_STAGING" - echo "ENV_KEYS_STAGING=$ENV_KEYS_STAGING" >> $GITHUB_ENV - - - name: Configure AWS production credentials - uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0 - with: - aws-access-key-id: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} - aws-region: ca-central-1 - - name: Get production env var keys run: | make decrypt-production @@ -53,14 +43,6 @@ jobs: echo "::add-mask::$ENV_KEYS_PRODUCTION" echo "ENV_KEYS_PRODUCTION=$ENV_KEYS_PRODUCTION" >> $GITHUB_ENV - - name: Test example and staging env vars - uses: ./.github/actions/diff-env-vars - with: - env1-name: EXAMPLE - env1-vars: ${{ env.ENV_KEYS_EXAMPLE }} - env2-name: STAGING - env2-vars: ${{ env.ENV_KEYS_STAGING }} - - name: Test example and production env vars uses: ./.github/actions/diff-env-vars if: always() @@ -69,12 +51,3 @@ jobs: env1-vars: ${{ env.ENV_KEYS_EXAMPLE }} env2-name: PRODUCTION env2-vars: ${{ env.ENV_KEYS_PRODUCTION }} - - - name: Test staging and production env vars - uses: ./.github/actions/diff-env-vars - if: always() - with: - env1-name: STAGING - env1-vars: ${{ env.ENV_KEYS_STAGING }} - env2-name: PRODUCTION - env2-vars: ${{ env.ENV_KEYS_PRODUCTION }} diff --git a/env/dev/kustomization.yaml b/env/dev/kustomization.yaml index 34c168844..75a49f70b 100644 --- a/env/dev/kustomization.yaml +++ b/env/dev/kustomization.yaml @@ -5,23 +5,23 @@ resources: - fluentbit.yaml - cwagent.yaml - cwagent-configmap.yaml - - notification-service-account.yaml - - api-target-group.yaml - - admin-target-group.yaml - - document-download-api-target-group.yaml - - documentation-target-group.yaml + # - notification-service-account.yaml + # - api-target-group.yaml + # - admin-target-group.yaml + # - document-download-api-target-group.yaml + # - documentation-target-group.yaml - ../../base/prometheus-cloudwatch - - ../../base/notify-admin - - ../../base/notify-api - - ../../base/notify-celery-other - - ../../base/notify-celery-main-primary - - ../../base/notify-celery-sms-send-primary - - ../../base/notify-celery-email-send-primary - - ../../base/notify-celery-main-scalable - - ../../base/notify-celery-sms-send-scalable - - ../../base/notify-celery-email-send-scalable - - ../../base/notify-document-download - - ../../base/notify-documentation + # - ../../base/notify-admin + # - ../../base/notify-api + # - ../../base/notify-celery-other + # - ../../base/notify-celery-main-primary + # - ../../base/notify-celery-sms-send-primary + # - ../../base/notify-celery-email-send-primary + # - ../../base/notify-celery-main-scalable + # - ../../base/notify-celery-sms-send-scalable + # - ../../base/notify-celery-email-send-scalable + # - ../../base/notify-document-download + # - ../../base/notify-documentation - ../../base/notify-system images: @@ -34,45 +34,45 @@ images: - name: documentation newName: public.ecr.aws/cds-snc/notify-documentation:latest -patches: - - path: performance/admin-hpa-patch.yaml - - path: performance/api-hpa-patch.yaml - - path: performance/celery-email-send-primary-deployment-patch.yaml - - path: performance/celery-email-send-scalable-deployment-patch.yaml - - path: performance/celery-email-send-scalable-hpa-patch.yaml - - path: performance/celery-primary-deployment-patch.yaml - - path: performance/celery-scalable-deployment-patch.yaml - - path: performance/celery-scalable-hpa-patch.yaml - - path: performance/celery-sms-send-primary-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-hpa-patch.yaml +# patches: +# - path: performance/admin-hpa-patch.yaml +# - path: performance/api-hpa-patch.yaml +# - path: performance/celery-email-send-primary-deployment-patch.yaml +# - path: performance/celery-email-send-scalable-deployment-patch.yaml +# - path: performance/celery-email-send-scalable-hpa-patch.yaml +# - path: performance/celery-primary-deployment-patch.yaml +# - path: performance/celery-scalable-deployment-patch.yaml +# - path: performance/celery-scalable-hpa-patch.yaml +# - path: performance/celery-sms-send-primary-deployment-patch.yaml +# - path: performance/celery-sms-send-scalable-deployment-patch.yaml +# - path: performance/celery-sms-send-scalable-hpa-patch.yaml - - path: services/admin-service-patch.yaml - - path: services/api-service-patch.yaml - - path: services/document-download-api-service-patch.yaml - - path: services/documentation-service-patch.yaml +# - path: services/admin-service-patch.yaml +# - path: services/api-service-patch.yaml +# - path: services/document-download-api-service-patch.yaml +# - path: services/documentation-service-patch.yaml - path: cwagent/cwagent-deployment-patch.yaml - - path: nodeselectors/admin-node-selector-patch.yaml - - path: nodeselectors/celery-api-node-selector-patch.yaml - - path: nodeselectors/celery-beat-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-primary-node-selector-patch.yaml - - path: nodeselectors/celery-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-sms-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml - - path: nodeselectors/document-download-api-node-selector-patch.yaml - - path: nodeselectors/documentation-node-selector-patch.yaml +# - path: nodeselectors/admin-node-selector-patch.yaml +# - path: nodeselectors/celery-api-node-selector-patch.yaml +# - path: nodeselectors/celery-beat-node-selector-patch.yaml +# - path: nodeselectors/celery-email-send-node-selector-patch.yaml +# - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml +# - path: nodeselectors/celery-primary-node-selector-patch.yaml +# - path: nodeselectors/celery-scalable-node-selector-patch.yaml +# - path: nodeselectors/celery-sms-node-selector-patch.yaml +# - path: nodeselectors/celery-sms-send-node-selector-patch.yaml +# - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml +# - path: nodeselectors/document-download-api-node-selector-patch.yaml +# - path: nodeselectors/documentation-node-selector-patch.yaml - - path: celery-init-delete/celery-email-send-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-email-send-scalable-init-delete-patch.yaml - - path: celery-init-delete/celery-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-scalable-init-delete-patch.yaml - - path: celery-init-delete/celery-sms-send-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-sms-send-scalable-init-delete-patch.yaml +# - path: celery-init-delete/celery-email-send-primary-init-delete-patch.yaml +# - path: celery-init-delete/celery-email-send-scalable-init-delete-patch.yaml +# - path: celery-init-delete/celery-primary-init-delete-patch.yaml +# - path: celery-init-delete/celery-scalable-init-delete-patch.yaml +# - path: celery-init-delete/celery-sms-send-primary-init-delete-patch.yaml +# - path: celery-init-delete/celery-sms-send-scalable-init-delete-patch.yaml configMapGenerator: - envs: diff --git a/env/sandbox/kustomization.yaml b/env/sandbox/kustomization.yaml index defee7a36..6c63d171b 100644 --- a/env/sandbox/kustomization.yaml +++ b/env/sandbox/kustomization.yaml @@ -5,24 +5,24 @@ resources: - fluentbit.yaml - cwagent.yaml - cwagent-configmap.yaml - - notification-service-account.yaml - - api-target-group.yaml - - admin-target-group.yaml - - document-download-api-target-group.yaml - - documentation-target-group.yaml + # - notification-service-account.yaml + # - api-target-group.yaml + # - admin-target-group.yaml + # - document-download-api-target-group.yaml + # - documentation-target-group.yaml - aws-auth-configmap.yaml - ../../base/prometheus-cloudwatch - - ../../base/notify-admin - - ../../base/notify-api - - ../../base/notify-celery-other - - ../../base/notify-celery-main-primary - - ../../base/notify-celery-sms-send-primary - - ../../base/notify-celery-email-send-primary - - ../../base/notify-celery-main-scalable - - ../../base/notify-celery-sms-send-scalable - - ../../base/notify-celery-email-send-scalable - - ../../base/notify-document-download - - ../../base/notify-documentation + # - ../../base/notify-admin + # - ../../base/notify-api + # - ../../base/notify-celery-other + # - ../../base/notify-celery-main-primary + # - ../../base/notify-celery-sms-send-primary + # - ../../base/notify-celery-email-send-primary + # - ../../base/notify-celery-main-scalable + # - ../../base/notify-celery-sms-send-scalable + # - ../../base/notify-celery-email-send-scalable + # - ../../base/notify-document-download + # - ../../base/notify-documentation - ../../base/notify-system images: @@ -36,44 +36,44 @@ images: newName: public.ecr.aws/cds-snc/notify-documentation:latest patches: - - path: performance/admin-hpa-patch.yaml - - path: performance/api-hpa-patch.yaml - - path: performance/celery-email-send-primary-deployment-patch.yaml - - path: performance/celery-email-send-scalable-deployment-patch.yaml - - path: performance/celery-email-send-scalable-hpa-patch.yaml - - path: performance/celery-primary-deployment-patch.yaml - - path: performance/celery-scalable-deployment-patch.yaml - - path: performance/celery-scalable-hpa-patch.yaml - - path: performance/celery-sms-send-primary-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-hpa-patch.yaml + # - path: performance/admin-hpa-patch.yaml + # - path: performance/api-hpa-patch.yaml + # - path: performance/celery-email-send-primary-deployment-patch.yaml + # - path: performance/celery-email-send-scalable-deployment-patch.yaml + # - path: performance/celery-email-send-scalable-hpa-patch.yaml + # - path: performance/celery-primary-deployment-patch.yaml + # - path: performance/celery-scalable-deployment-patch.yaml + # - path: performance/celery-scalable-hpa-patch.yaml + # - path: performance/celery-sms-send-primary-deployment-patch.yaml + # - path: performance/celery-sms-send-scalable-deployment-patch.yaml + # - path: performance/celery-sms-send-scalable-hpa-patch.yaml - - path: services/admin-service-patch.yaml - - path: services/api-service-patch.yaml - - path: services/document-download-api-service-patch.yaml - - path: services/documentation-service-patch.yaml + # - path: services/admin-service-patch.yaml + # - path: services/api-service-patch.yaml + # - path: services/document-download-api-service-patch.yaml + # - path: services/documentation-service-patch.yaml - path: cwagent/cwagent-deployment-patch.yaml - - path: nodeselectors/admin-node-selector-patch.yaml - - path: nodeselectors/celery-api-node-selector-patch.yaml - - path: nodeselectors/celery-beat-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-primary-node-selector-patch.yaml - - path: nodeselectors/celery-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-sms-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml - - path: nodeselectors/document-download-api-node-selector-patch.yaml - - path: nodeselectors/documentation-node-selector-patch.yaml + # - path: nodeselectors/admin-node-selector-patch.yaml + # - path: nodeselectors/celery-api-node-selector-patch.yaml + # - path: nodeselectors/celery-beat-node-selector-patch.yaml + # - path: nodeselectors/celery-email-send-node-selector-patch.yaml + # - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml + # - path: nodeselectors/celery-primary-node-selector-patch.yaml + # - path: nodeselectors/celery-scalable-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-send-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml + # - path: nodeselectors/document-download-api-node-selector-patch.yaml + # - path: nodeselectors/documentation-node-selector-patch.yaml - - path: celery-init-delete/celery-email-send-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-email-send-scalable-init-delete-patch.yaml - - path: celery-init-delete/celery-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-scalable-init-delete-patch.yaml - - path: celery-init-delete/celery-sms-send-primary-init-delete-patch.yaml - - path: celery-init-delete/celery-sms-send-scalable-init-delete-patch.yaml + # - path: celery-init-delete/celery-email-send-primary-init-delete-patch.yaml + # - path: celery-init-delete/celery-email-send-scalable-init-delete-patch.yaml + # - path: celery-init-delete/celery-primary-init-delete-patch.yaml + # - path: celery-init-delete/celery-scalable-init-delete-patch.yaml + # - path: celery-init-delete/celery-sms-send-primary-init-delete-patch.yaml + # - path: celery-init-delete/celery-sms-send-scalable-init-delete-patch.yaml configMapGenerator: - envs: diff --git a/env/staging/kustomization.yaml b/env/staging/kustomization.yaml index b12e4f64b..9c91d395c 100644 --- a/env/staging/kustomization.yaml +++ b/env/staging/kustomization.yaml @@ -5,64 +5,64 @@ resources: - fluentbit.yaml - cwagent.yaml - cwagent-configmap.yaml - - notification-service-account.yaml - - api-target-group.yaml - - admin-target-group.yaml - - document-download-api-target-group.yaml - - documentation-target-group.yaml + # - notification-service-account.yaml + # - api-target-group.yaml + # - admin-target-group.yaml + # - document-download-api-target-group.yaml + # - documentation-target-group.yaml - aws-auth-configmap.yaml - ../../base/prometheus-cloudwatch - - ../../base/notify-admin - - ../../base/notify-api - - ../../base/notify-celery-other - - ../../base/notify-celery-main-primary - - ../../base/notify-celery-sms-send-primary - - ../../base/notify-celery-email-send-primary - - ../../base/notify-celery-main-scalable - - ../../base/notify-celery-sms-send-scalable - - ../../base/notify-celery-email-send-scalable - - ../../base/notify-document-download - - ../../base/notify-documentation + # - ../../base/notify-admin + # - ../../base/notify-api + # - ../../base/notify-celery-other + # - ../../base/notify-celery-main-primary + # - ../../base/notify-celery-sms-send-primary + # - ../../base/notify-celery-email-send-primary + # - ../../base/notify-celery-main-scalable + # - ../../base/notify-celery-sms-send-scalable + # - ../../base/notify-celery-email-send-scalable + # - ../../base/notify-document-download + # - ../../base/notify-documentation - ../../base/notify-system patches: - - path: performance/admin-hpa-patch.yaml - - path: performance/admin-deployment-patch.yaml - - path: performance/api-hpa-patch.yaml - - path: performance/api-deployment-patch.yaml - - path: performance/celery-email-send-primary-deployment-patch.yaml - - path: performance/celery-email-send-scalable-deployment-patch.yaml - - path: performance/celery-email-send-scalable-hpa-patch.yaml - - path: performance/celery-primary-deployment-patch.yaml - - path: performance/celery-scalable-deployment-patch.yaml - - path: performance/celery-scalable-hpa-patch.yaml - - path: performance/celery-sms-send-primary-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-deployment-patch.yaml - - path: performance/celery-sms-send-scalable-hpa-patch.yaml - - path: performance/document-download-api-hpa-patch.yaml - - path: performance/documentation-deployment-patch.yaml + # - path: performance/admin-hpa-patch.yaml + # - path: performance/admin-deployment-patch.yaml + # - path: performance/api-hpa-patch.yaml + # - path: performance/api-deployment-patch.yaml + # - path: performance/celery-email-send-primary-deployment-patch.yaml + # - path: performance/celery-email-send-scalable-deployment-patch.yaml + # - path: performance/celery-email-send-scalable-hpa-patch.yaml + # - path: performance/celery-primary-deployment-patch.yaml + # - path: performance/celery-scalable-deployment-patch.yaml + # - path: performance/celery-scalable-hpa-patch.yaml + # - path: performance/celery-sms-send-primary-deployment-patch.yaml + # - path: performance/celery-sms-send-scalable-deployment-patch.yaml + # - path: performance/celery-sms-send-scalable-hpa-patch.yaml + # - path: performance/document-download-api-hpa-patch.yaml + # - path: performance/documentation-deployment-patch.yaml - - path: services/admin-service-patch.yaml - - path: services/api-service-patch.yaml - - path: services/document-download-api-service-patch.yaml - - path: services/documentation-service-patch.yaml + # - path: services/admin-service-patch.yaml + # - path: services/api-service-patch.yaml + # - path: services/document-download-api-service-patch.yaml + # - path: services/documentation-service-patch.yaml - path: cwagent/cwagent-deployment-patch.yaml - - path: nodeselectors/admin-node-selector-patch.yaml - - path: nodeselectors/api-node-selector-patch.yaml - - path: nodeselectors/celery-api-node-selector-patch.yaml - - path: nodeselectors/celery-beat-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-node-selector-patch.yaml - - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-primary-node-selector-patch.yaml - - path: nodeselectors/celery-scalable-node-selector-patch.yaml - - path: nodeselectors/celery-sms-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-node-selector-patch.yaml - - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml - - path: nodeselectors/document-download-api-node-selector-patch.yaml - - path: nodeselectors/documentation-node-selector-patch.yaml + # - path: nodeselectors/admin-node-selector-patch.yaml + # - path: nodeselectors/api-node-selector-patch.yaml + # - path: nodeselectors/celery-api-node-selector-patch.yaml + # - path: nodeselectors/celery-beat-node-selector-patch.yaml + # - path: nodeselectors/celery-email-send-node-selector-patch.yaml + # - path: nodeselectors/celery-email-send-scalable-node-selector-patch.yaml + # - path: nodeselectors/celery-primary-node-selector-patch.yaml + # - path: nodeselectors/celery-scalable-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-send-node-selector-patch.yaml + # - path: nodeselectors/celery-sms-send-scalable-node-selector-patch.yaml + # - path: nodeselectors/document-download-api-node-selector-patch.yaml + # - path: nodeselectors/documentation-node-selector-patch.yaml images: - name: admin diff --git a/helmfile/charts/notify-celery/templates/hpa.yaml b/helmfile/charts/notify-celery/templates/hpa.yaml index 9029fa9e3..bcf9207f1 100644 --- a/helmfile/charts/notify-celery/templates/hpa.yaml +++ b/helmfile/charts/notify-celery/templates/hpa.yaml @@ -27,7 +27,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: celery-{{ $node.name }} + name: notify-celery-{{ $node.name }} {{- end }} --- {{- end }} diff --git a/helmfile/charts/notify-celery/templates/service.yaml b/helmfile/charts/notify-celery/templates/service.yaml new file mode 100644 index 000000000..56d9e1c9a --- /dev/null +++ b/helmfile/charts/notify-celery/templates/service.yaml @@ -0,0 +1,22 @@ +{{- range $node := .Values.nodes }} +{{- with $ -}} +{{ if $node.service.serviceEnabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "celery.fullname" . }}-{{ $node.name }} + labels: + app: {{ include "celery.fullname" . }}-{{ $node.name }} + namespace: notification-canada-ca +spec: + type: ClusterIP + # Putting a dummy port because we need to specify ports + ports: + - port: 80 + targetPort: 80 + selector: + app: notify-celery-{{ $node.name }} +{{- end }} +{{- end }} +--- +{{- end }} diff --git a/helmfile/charts/notify-celery/values.yaml b/helmfile/charts/notify-celery/values.yaml index c788c27b3..972cb1518 100644 --- a/helmfile/charts/notify-celery/values.yaml +++ b/helmfile/charts/notify-celery/values.yaml @@ -21,7 +21,7 @@ celeryCommon: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED: true NEW_RELIC_MONITOR_MODE: false AWS_XRAY_CONTEXT_MISSING: "LOG_WARNING" - AWS_XRAY_DAEMON_ADDRESS: "xray-daemon.notification-canada-ca.svc.cluster.local:2000" + AWS_XRAY_DAEMON_ADDRESS: "xray-daemon-aws-xray.xray.svc.cluster.local:2000" AWS_XRAY_SDK_ENABLED: true ASSET_DOMAIN: "assets.dev.notification.cdssandbox.xyz" BATCH_INSERTION_CHUNK_SIZE: "10" @@ -58,6 +58,8 @@ nodes: pdbEnabled: false autoscaling: hpaEnabled: false + service: + serviceEnabled: true other-beat: name: beat newRelicAppName: "notification-celery-beat-dev" @@ -72,6 +74,8 @@ nodes: pdbEnabled: false autoscaling: hpaEnabled: false + service: + serviceEnabled: true # PRIMARY CONFIGS primary-main: name: primary @@ -96,6 +100,8 @@ nodes: minAvailable: 2 autoscaling: hpaEnabled: false + service: + serviceEnabled: true primary-email: name: email-send-primary newRelicAppName: "notification-celery-email-send-primary-dev" @@ -119,6 +125,8 @@ nodes: minAvailable: 2 autoscaling: hpaEnabled: false + service: + serviceEnabled: true primary-sms: name: sms-send-primary newRelicAppName: "notification-celery-sms-send-primary-dev" @@ -142,6 +150,8 @@ nodes: minAvailable: 2 autoscaling: hpaEnabled: false + service: + serviceEnabled: true # SCALABLE CONFIGS scalable-main: name: scalable @@ -171,6 +181,8 @@ nodes: pdb: pdbEnabled: true minAvailable: 2 + service: + serviceEnabled: true scalable-email: name: email-send-scalable newRelicAppName: "notification-celery-email-send-scalable-dev" @@ -199,6 +211,8 @@ nodes: pdb: pdbEnabled: true minAvailable: 2 + service: + serviceEnabled: true scalable-sms: name: sms-send-scalable newRelicAppName: "notification-celery-sms-send-scalable-dev" @@ -227,7 +241,9 @@ nodes: pdb: pdbEnabled: true minAvailable: 2 - + service: + serviceEnabled: true + image: repository: public.ecr.aws/cds-snc/notify-api pullPolicy: Always diff --git a/helmfile/helmfile.yaml b/helmfile/helmfile.yaml index 94f73fdc9..615dae36e 100644 --- a/helmfile/helmfile.yaml +++ b/helmfile/helmfile.yaml @@ -34,7 +34,7 @@ repositories: url: https://okgolove.github.io/helm-charts releases: -{{ if eq .Environment.Name "dev" }} +{{ if or (eq .Environment.Name "dev") (eq .Environment.Name "staging") }} - name: notify-documentation namespace: notification-canada-ca labels: diff --git a/helmfile/overrides/notify/admin.yaml.gotmpl b/helmfile/overrides/notify/admin.yaml.gotmpl index a7dcf33c8..1bbbb5900 100644 --- a/helmfile/overrides/notify/admin.yaml.gotmpl +++ b/helmfile/overrides/notify/admin.yaml.gotmpl @@ -34,7 +34,7 @@ serviceAccount: eks.amazonaws.com/role-arn: arn:aws:iam::{{ requiredEnv "AWS_ACCOUNT_ID" }}:role/admin-eks-role targetGroupBinding: - enabled: {{ if eq .Environment.Name "production" }} false {{ else if eq .Environment.Name "staging" }} false {{ else }} false {{ end }} + enabled: {{ if eq .Environment.Name "production" }} true {{ else if eq .Environment.Name "staging" }} true {{ else }} true {{ end }} targetGroupARN: {{requiredEnv "ADMIN_TARGET_GROUP_ARN"}} resources: diff --git a/helmfile/overrides/notify/api.yaml.gotmpl b/helmfile/overrides/notify/api.yaml.gotmpl index bfb8f86d6..3d5bb5fbb 100644 --- a/helmfile/overrides/notify/api.yaml.gotmpl +++ b/helmfile/overrides/notify/api.yaml.gotmpl @@ -27,7 +27,7 @@ serviceAccount: eks.amazonaws.com/role-arn: arn:aws:iam::{{ requiredEnv "AWS_ACCOUNT_ID" }}:role/api-eks-role targetGroupBinding: - enabled: {{ if eq .Environment.Name "production" }} false {{ else if eq .Environment.Name "staging" }} false {{ else }} false {{ end }} + enabled: {{ if eq .Environment.Name "production" }} true {{ else if eq .Environment.Name "staging" }} true {{ else }} true {{ end }} targetGroupARN: {{requiredEnv "API_TARGET_GROUP_ARN"}} resources: diff --git a/helmfile/overrides/notify/document-download.yaml.gotmpl b/helmfile/overrides/notify/document-download.yaml.gotmpl index 27fbbbf4b..02e8e8ffb 100644 --- a/helmfile/overrides/notify/document-download.yaml.gotmpl +++ b/helmfile/overrides/notify/document-download.yaml.gotmpl @@ -21,7 +21,7 @@ serviceAccount: eks.amazonaws.com/role-arn: arn:aws:iam::{{ requiredEnv "AWS_ACCOUNT_ID" }}:role/document-download-eks-role targetGroupBinding: - enabled: {{ if eq .Environment.Name "production" }} false {{ else if eq .Environment.Name "staging" }} false {{ else }} false {{ end }} + enabled: {{ if eq .Environment.Name "production" }} true {{ else if eq .Environment.Name "staging" }} true {{ else }} true {{ end }} targetGroupARN: {{requiredEnv "DOCUMENT_DOWNLOAD_API_TARGET_GROUP_ARN"}} resources: diff --git a/helmfile/overrides/notify/documentation.yaml.gotmpl b/helmfile/overrides/notify/documentation.yaml.gotmpl index a91c1f907..f8407ae9f 100644 --- a/helmfile/overrides/notify/documentation.yaml.gotmpl +++ b/helmfile/overrides/notify/documentation.yaml.gotmpl @@ -2,7 +2,7 @@ image: tag: "910f947" targetGroupBinding: - enabled: {{ if eq .Environment.Name "production" }} false {{ else if eq .Environment.Name "staging" }} false {{ else }} false {{ end }} + enabled: {{ if eq .Environment.Name "production" }} true {{ else if eq .Environment.Name "staging" }} true {{ else }} true {{ end }} targetGroupARN: {{requiredEnv "DOCUMENTATION_TARGET_GROUP_ARN"}} pdb: