diff --git a/stable/concourse/Chart.yaml b/stable/concourse/Chart.yaml index 859b51a618ec..d07e6cf74bee 100644 --- a/stable/concourse/Chart.yaml +++ b/stable/concourse/Chart.yaml @@ -1,5 +1,5 @@ name: concourse -version: 0.1.3 +version: 0.2.0 description: Concourse is a simple and scalable CI system. icon: https://avatars1.githubusercontent.com/u/7809479 keywords: diff --git a/stable/concourse/README.md b/stable/concourse/README.md index d3f83487b36b..d986f039d688 100644 --- a/stable/concourse/README.md +++ b/stable/concourse/README.md @@ -53,6 +53,30 @@ Scaling should typically be managed via the `helm upgrade` command, but `Statefu $ kubectl scale statefulset my-release-worker --replicas=3 ``` +### Restarting workers + +If worker pods go down, their persistent volumes are changed, or if you're having other issues with them, you'll need to restart the workers. Concourse workers were designed to be deployed onto infrastructure VMs which are less "ephemeral" than pods, so it isn't good at detecting when a worker goes down and comes back under the same hostname. + +Scale the workers down to 0: + +``` +kubectl scale statefulset concourse-worker --replicas=0 + +``` + +And then `fly workers` until the workers are detected to be `stalled`. Then for each worker +``` +fly prune-worker -w concourse-worker-0 +fly prune-worker -w concourse-worker-1 +... + +``` +And finally + +``` +kubectl scale statefulset concourse-worker --replicas=3 +``` + ## Configuration The following tables lists the configurable parameters of the Concourse chart and their default values. @@ -110,6 +134,8 @@ The following tables lists the configurable parameters of the Concourse chart an | `persistence.worker.class` | Concourse Worker Persistent Volume Storage Class | `generic` | | `persistence.worker.accessMode` | Concourse Worker Persistent Volume Access Mode | `ReadWriteOnce` | | `persistence.worker.size` | Concourse Worker Persistent Volume Storage Size | `10Gi` | +| `postgresql.enabled` | Enable PostgreSQL as a chart dependency | `true` | +| `postgresql.uri` | PostgreSQL connection URI | `nil` | | `postgresql.postgresUser` | PostgreSQL User to create | `concourse` | | `postgresql.postgresPassword` | PostgreSQL Password for the new user | `concourse` | | `postgresql.postgresDatabase` | PostgreSQL Database to create | `concourse` | @@ -244,3 +270,26 @@ web: hosts: - concourse.domain.com ``` + + +### PostgreSQL + +By default, this chart will use a PostgreSQL database deployed as a chart dependency. You can also bring your own PostgreSQL. To do so, set the following in your custom `values.yaml` file: + +```yaml +## Configuration values for the postgresql dependency. +## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md +## +postgresql: + + ## Use the PostgreSQL chart dependency. + ## Set to false if bringing your own PostgreSQL. + ## + enabled: false + + ## If bringing your own PostgreSQL, the full uri to use + ## e.g. postgres://concourse:changeme@my-postgres.com:5432/concourse?sslmode=require + ## + uri: postgres://concourse:changeme@my-postgres.com:5432/concourse?sslmode=require + +``` diff --git a/stable/concourse/requirements.yaml b/stable/concourse/requirements.yaml index 8e2aa4661dde..3fcbb5423e6e 100644 --- a/stable/concourse/requirements.yaml +++ b/stable/concourse/requirements.yaml @@ -2,3 +2,4 @@ dependencies: - name: postgresql version: 0.3.0 repository: https://kubernetes-charts.storage.googleapis.com/ + condition: postgresql.enabled diff --git a/stable/concourse/templates/secrets.yaml b/stable/concourse/templates/secrets.yaml index 3205fac9a331..0178ad946a63 100644 --- a/stable/concourse/templates/secrets.yaml +++ b/stable/concourse/templates/secrets.yaml @@ -9,7 +9,11 @@ metadata: heritage: "{{ .Release.Service }}" type: Opaque data: + {{ if .Values.postgresql.enabled }} postgresql-user: {{ .Values.postgresql.postgresUser | b64enc | quote }} + {{ else }} + postgresql-uri: {{ .Values.postgresql.uri | b64enc | quote }} + {{ end }} basic-auth-username: {{ .Values.concourse.username | b64enc | quote }} basic-auth-password: {{ .Values.concourse.password | b64enc | quote }} host-key: {{ .Values.concourse.hostKey | b64enc | quote }} diff --git a/stable/concourse/templates/web-deployment.yaml b/stable/concourse/templates/web-deployment.yaml index 597eb19f4568..9e14bac36f2b 100644 --- a/stable/concourse/templates/web-deployment.yaml +++ b/stable/concourse/templates/web-deployment.yaml @@ -21,6 +21,7 @@ spec: args: - "web" env: + {{ if .Values.postgresql.enabled }} - name: POSTGRES_HOST valueFrom: configMapKeyRef: @@ -43,6 +44,13 @@ spec: key: postgresql-database - name: CONCOURSE_POSTGRES_DATA_SOURCE value: postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST)/$(POSTGRES_DATABASE)?sslmode=disable + {{ else }} + - name: CONCOURSE_POSTGRES_DATA_SOURCE + valueFrom: + secretKeyRef: + name: {{ template "concourse.fullname" . }} + key: postgresql-uri + {{ end }} - name: POD_IP valueFrom: fieldRef: diff --git a/stable/concourse/values.yaml b/stable/concourse/values.yaml index 44e0756c51a5..25806aac8dfd 100644 --- a/stable/concourse/values.yaml +++ b/stable/concourse/values.yaml @@ -350,6 +350,17 @@ persistence: ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md ## postgresql: + + ## Use the PostgreSQL chart dependency. + ## Set to false if bringing your own PostgreSQL. + ## + enabled: true + + ## If bringing your own PostgreSQL, the full uri to use + ## e.g. postgres://concourse:changeme@my-postgres.com:5432/concourse?sslmode=disable + ## + # uri: + ### PostgreSQL User to create. ## postgresUser: concourse