Skip to content

Commit

Permalink
Merge pull request #55 from alphagov/add-dgu-redis
Browse files Browse the repository at this point in the history
Add dgu redis
  • Loading branch information
kentsanggds committed Dec 7, 2023
2 parents 59b5f5c + 8569187 commit c66b5a4
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 31 deletions.
2 changes: 1 addition & 1 deletion charts/app-of-apps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: app-of-apps
description: Deploys CKAN applications
type: application
version: 1.1.0
version: 1.2.0
26 changes: 26 additions & 0 deletions charts/app-of-apps/templates/dgu-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: dgu
namespace: cluster-services
spec:
project: datagovuk
source:
repoURL: https://github.com/alphagov/govuk-dgu-charts
path: charts/dgu
targetRevision: HEAD
helm:
values: |
{{- toYaml .Values.dguHelmValues | nindent 8 }}
destination:
server: https://kubernetes.default.svc
namespace: datagovuk
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=false
- PrunePropagationPolicy=foreground
- PruneLast=true
- ApplyOutOfSyncOnly=true
10 changes: 6 additions & 4 deletions charts/app-of-apps/values-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ckanHelmValues:
title: "data.gov.uk"
dbHost: "ckan-postgres.integration.govuk-internal.digital"
redis:
host: "shared-redis-govuk.eks.integration.govuk-internal.digital"
host: "dgu-redis"
smtp:
server: "email-smtp.eu-west-1.amazonaws.com:587"
user: "AKIATB5RC4XX4VZIWMF7"
Expand Down Expand Up @@ -70,7 +70,7 @@ datagovukHelmValues:
key: publish_sqlalchemy_url
dbHost: ""
redis:
host: "shared-redis-govuk.eks.integration.govuk-internal.digital"
host: "dgu-redis"
port: "6379"
dbNumber: "1"
org:
Expand All @@ -79,7 +79,7 @@ datagovukHelmValues:
replicaCount: 1
args: ["bin/rails s -b 0.0.0.0 --pid /tmp/rails-server.pid"]
ingress:
host: find.eks.integration.govuk.digital
host: integration.data.gov.uk
ingressClassName: aws-alb
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
Expand All @@ -95,4 +95,6 @@ datagovukHelmValues:
externalSecret:
enabled: true


dguHelmValues:
redis:
replicaCount: 1
4 changes: 4 additions & 0 deletions charts/app-of-apps/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ datagovukHelmValues:
replicaCount: 1
externalSecret:
enabled: true

dguHelmValues:
redis:
replicaCount: 0
6 changes: 5 additions & 1 deletion charts/app-of-apps/values-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ datagovukHelmValues:
replicaCount: 1
args: [ "bin/rails s -b 0.0.0.0 --pid /tmp/rails-server.pid" ]
ingress:
host: find.eks.staging.govuk.digital
host: staging.data.gov.uk
ingressClassName: aws-alb
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
Expand All @@ -95,3 +95,7 @@ datagovukHelmValues:
replicaCount: 1
externalSecret:
enabled: true

dguHelmValues:
redis:
replicaCount: 0
4 changes: 4 additions & 0 deletions charts/app-of-apps/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ datagovukHelmValues:

opensearch:
replicaCount: 1

dguHelmValues:
redis:
replicaCount: 1
1 change: 1 addition & 0 deletions charts/ckan/templates/ckan/init-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data:
ckan config-tool $CKAN_INI "beaker.session.secret=$CKAN_BEAKER_SESSION_SECRET"
{{- if $.Values.dev.enabled }}
ckan config-tool $CKAN_INI "ckan.mock_harvest_source = http://{{ $.Release.Name }}-static-harvest-source:11088/"
ckan config-tool $CKAN_INI "ckan.datagovuk.s3_aws_access_key_id = $CKAN_AWS_ACCESS_KEY_ID"
ckan config-tool $CKAN_INI "ckan.datagovuk.s3_aws_secret_access_key = $CKAN_AWS_ACCESS_KEY_SECRET"
{{- end }}
Expand Down
13 changes: 3 additions & 10 deletions charts/ckan/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
environment: test

ckan:
replicaCount: 1
serviceAccount:
Expand Down Expand Up @@ -26,7 +28,7 @@ ckan:
key: sqlalchemy_url
dbHost: ""
redis:
host: ""
host: "dgu-dev-redis"
port: "6379"
dbNumber: "1"
beakerSessionSecretKeyRef:
Expand Down Expand Up @@ -81,20 +83,11 @@ gather:
fetch:
replicaCount: 1

environment: test

pycsw:
replicaCount: 1
args: ["python $CKAN_VENV/src/pycsw/pycsw/wsgi.py"]
probes:
enabled: false
ingress:
enabled: true
host: pycsw.data.gov.uk
ingressClassName: ""
annotations:
tls:
enabled: false

externalSecret:
enabled: false
Expand Down
4 changes: 2 additions & 2 deletions charts/datagovuk/templates/_find.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: {{ .sentryDsnSecretKeyRef.name }}
key: {{ .sentryDsnSecretKeyRef.key }}
name: {{ .findSentryDsnSecretKeyRef.name }}
key: {{ .findSentryDsnSecretKeyRef.key }}
- name: ZENDESK_API_KEY
valueFrom:
secretKeyRef:
Expand Down
6 changes: 3 additions & 3 deletions charts/datagovuk/templates/_publish.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- name: RAILS_ENV
value: {{ $environment }}
- name: REDIS_HOST
value: redis://{{ .redis.host | default "ckan-redis" }}/{{ .redis.dbNumber | default "1" }}
value: {{ .redis.host | default "dgu-redis" }}
- name: ES_INDEX
value: datasets-{{ $environment }}
- name: RAILS_LOG_TO_STDOUT
Expand All @@ -25,8 +25,8 @@
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: {{ .sentryDsnSecretKeyRef.name }}
key: {{ .sentryDsnSecretKeyRef.key }}
name: {{ .publishSentryDsnSecretKeyRef.name }}
key: {{ .publishSentryDsnSecretKeyRef.key }}
- name: GOVUK_APP_DOMAIN
value: "www.gov.uk"
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/datagovuk/templates/publish/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ spec:
volumeMounts:
- name: publish-init
mountPath: /init
- name: app-tmp
mountPath: /srv/app/datagovuk_publish/tmp
containers:
- name: publish
image: '{{ include "docker-uri" (dict "environment" .Values.environment "app" "publish" "files" $.Files) }}'
Expand All @@ -38,3 +40,5 @@ spec:
- name: publish-init
configMap:
name: {{ .Release.Name }}-publish-init
- name: app-tmp
emptyDir: {}
8 changes: 3 additions & 5 deletions charts/datagovuk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ publish:
sqlalchemyUrlSecretKeyRef:
name: datagovuk
key: publish_sqlalchemy_url
sentryDsnSecretKeyRef:
publishSentryDsnSecretKeyRef:
name: datagovuk
key: publish_sentry_dsn
govukAppDomainSecretKeyRef:
name: datagovuk
key: govuk_app_domain
redis:
host: "ckan-dev"
host: "dgu-dev-redis"
port: "6379"
dbNumber: "1"
org:
Expand All @@ -36,8 +36,6 @@ find:
host: find.data.gov.uk
ingressClassName: ""
annotations:
tls:
enabled: false
config:
ckanDomain: "ckan.publishing.service.gov.uk"
secretKeyBaseSecretKeyRef:
Expand All @@ -49,7 +47,7 @@ find:
zendeskUsernameSecretKeyRef:
name: datagovuk
key: zendesk_username
sentryDsnSecretKeyRef:
findSentryDsnSecretKeyRef:
name: datagovuk
key: find_sentry_dsn

Expand Down
5 changes: 5 additions & 0 deletions charts/dgu/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: govuk-dgu
description: DGU shared resources
type: application
version: 1.1.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.redis.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -11,4 +10,3 @@ spec:
protocol: TCP
port: 6379
targetPort: redis
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if .Values.redis.enabled }}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-redis
spec:
serviceName: "redis"
selector:
matchLabels:
app: {{ .Release.Name }}-redis
Expand All @@ -18,4 +18,3 @@ spec:
ports:
- name: redis
containerPort: 6379
{{- end }}
9 changes: 9 additions & 0 deletions charts/dgu/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
environment: test

redis:
replicaCount: 1
enabled: true
image: redis:6.2.5-alpine3.14
persistence:
enabled: true
persistentVolumeClaimName: "redis"

0 comments on commit c66b5a4

Please sign in to comment.