Commit 5f13b05f authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Merge branch 'beta' into beta-to-master

parents ba0e04f4 0496ec5b
Loading
Loading
Loading
Loading
+8 −66
Original line number Diff line number Diff line
@@ -80,45 +80,6 @@ test-deploy-name:
        exit 1
      fi

test-auto_database_url:
  <<: *test-job
  variables:
    CI_ENVIRONMENT_SLUG: production
    POSTGRES_USER: user
    POSTGRES_PASSWORD: testing-password
    POSTGRES_DB: $CI_ENVIRONMENT_SLUG
  script:
    # default is channel 2
    - auto_database_url=$(auto-deploy auto_database_url)
    - export expected_url="postgres://user:testing-password@production-postgresql:5432/production"
    - |
      if [[ $auto_database_url != $expected_url ]]; then
        echo "\$auto_database_url = '${auto_database_url}', want '${expected_url}'"
        exit 1
      fi
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=a
    - auto-deploy auto_database_url && expected_error || failed_as_expected
    # test that channel 1 still works
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=1
    - auto_database_url=$(auto-deploy auto_database_url)
    - export expected_url="postgres://user:testing-password@production-postgres:5432/production"
    - |
      if [[ $auto_database_url != $expected_url ]]; then
        echo "\$auto_database_url = '${auto_database_url}', want '${expected_url}'"
        exit 1
      fi
    # test explicit channel 2 just in case
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=2
    - auto_database_url=$(auto-deploy auto_database_url)
    - export expected_url="postgres://user:testing-password@production-postgresql:5432/production"
    - |
      if [[ $auto_database_url != $expected_url ]]; then
        echo "\$auto_database_url = '${auto_database_url}', want '${expected_url}'"
        exit 1
      fi
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=a
    - auto-deploy auto_database_url && expected_error || failed_as_expected

test-get-replicas:
  <<: *test-job
  variables:
@@ -379,37 +340,18 @@ test-scale-does-not-delete-old-postgres:
        exit 1
      fi

test-deploy-does-not-delete-old-postgres-by-default:
  extends: test-deploy
  script:
    - auto-deploy download_chart
    # make sure old posgres deployment exists
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=1
    - auto-deploy deploy
    - ./test/verify-deployment-database production production-postgres
    # test that the deploy job fails with default channel:2
    - unset AUTO_DEVOPS_POSTGRES_CHANNEL
    - auto-deploy deploy && expected_error || failed_as_expected
    # assert that postgres still exists
    - ./test/verify-deployment-database production production-postgres

test-deploy-deletes-old-postgres-if-opt-in:
test-show-warning-for-legacy-in-cluster-postgresql:
  extends: test-deploy
  variables:
      AUTO_DEVOPS_DEPLOY_DEBUG: 1
  script:
    # Create a release/deployment
    - auto-deploy download_chart
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=1
    # make sure old postgres deployment exists
    - auto-deploy deploy
    - ./test/verify-deployment-database production production-postgres
    # test that the deploy job succeeds
    - export POSTGRES_VERSION='9.6.16'
    - export AUTO_DEVOPS_POSTGRES_CHANNEL=2
    - export AUTO_DEVOPS_POSTGRES_DELETE_V1=1
    - auto-deploy deploy
    # test that the new postgres is up
    - ./test/verify-deployment-database production postgresql
    # Forcibly update the release that a legacy in-cluster postgresql exists in it
    - helm upgrade --reuse-values --wait --set postgresql.enabled="true" --namespace="$KUBE_NAMESPACE" "${CI_ENVIRONMENT_SLUG}" chart/
    - helm get values --namespace "$KUBE_NAMESPACE" --output json "${CI_ENVIRONMENT_SLUG}"
    # It should see an error when the deployment is upgraded
    - auto-deploy deploy| tee deploy.log || true
    - grep -q "Detected an existing PostgreSQL database" deploy.log || exit 1

test-deploy-k8s-1.16:
  extends: test-deploy
+0 −6
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ If you have any questions, please ask in <https://gitlab.com/gitlab-org/charts/a
| readinessProbe.timeoutSeconds | # of seconds after which the readiness probe times out. | `3`                                |
| readinessProbe.probeType     | Type of [readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes) to use. | `httpGet`
| readinessProbe.command       | Commands for use with probe type 'exec'. | `{}`
| postgresql.enabled            |             | `true`                             |
| postgresql.managed            | If true, this will provision a managed Postgres instance via crossplane.            | `false`                             |
| postgresql.managedClassSelector            | This will allow provisioning a Postgres instance based on label selectors via Crossplane, eg: `managedClassSelector.matchLabels.stack: gitlab`. The `postgresql.managed` value should be true as well for this to be honoured. [Crossplane Configuration](https://docs.gitlab.com/ee/user/clusters/applications.html#crossplane)            | `{}`                             |
| podDisruptionBudget.enabled   |             | `false`                            |
@@ -75,8 +74,3 @@ If you have any questions, please ask in <https://gitlab.com/gitlab-org/charts/a
| prometheus.metrics            | Annotates the service for prometheus auto-discovery. Also denies access to the `/metrics` endpoint from external addresses with Ingress. | `false` |
| networkPolicy.enabled         | Enable container network policy | `false` |
| networkPolicy.spec            | [Network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) definition | `{ podSelector: { matchLabels: {} }, ingress: [{ from: [{ podSelector: { matchLabels: {} } }, { namespaceSelector: { matchLabels: { app.gitlab.com/managed_by: gitlab } } }] }] }` |

## PostgreSQL

This chart depends on version 0.7.1 of the `stable/postgresql` chart.
For reference the source code for this specific version can be found at https://github.com/helm/charts/tree/b90ad657e1a226eb52c3eb6a2a95ba3d6d494f58/stable/postgresql
+0 −6
Original line number Diff line number Diff line
dependencies:
- name: postgresql
  repository: https://charts.helm.sh/stable
  version: 0.7.1
digest: sha256:66df3bd5a18622e28ed1ecedcceaff19e87f8e2f67baacf871331d64a5fdfa1f
generated: "2020-10-30T20:01:41.436662+13:00"
+0 −7
Original line number Diff line number Diff line
dependencies:
  # This is a legacy in-cluster PostgreSQL dependency that is no longer used for newer installations.
  # We can remove this dependency when we drop support for the legacy instances.
  - name: postgresql
    version: "0.7.1"
    repository: "@stable"
    condition: postgresql.enabled
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ readinessProbe:
  scheme: "HTTP"
  probeType: "httpGet"
postgresql:
  enabled: true
  managed: false
  managedClassSelector:
    #   matchLabels:
Loading