Skip to content

Commit

Permalink
feat: separate out Redis from the Nautobot deploy
Browse files Browse the repository at this point in the history
The Nautobot chart shouldn't deploy its own copy of Redis so break that
out. This simplifies secret handling of the Redis password by the
Nautobot chart as well. The service account is properly created by the
Redis chart as well so that can be removed.
  • Loading branch information
cardoe committed Feb 4, 2024
1 parent b11d05a commit 82dbc9c
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 408 deletions.
1 change: 1 addition & 0 deletions apps/components/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ resources:
- rabbitmq-cluster.yaml
- memcached.yaml
- postgres-db.yaml
- nautobot-redis.yaml
- nautobot.yaml
- keystone.yaml
16 changes: 16 additions & 0 deletions apps/components/nautobot-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: nautobot-redis
spec:
project: understack
source:
repoURL: https://github.com/rackerlabs/understack.git
path: components/08-nautobot-redis/
targetRevision: HEAD
destination:
server: "https://kubernetes.default.svc"
namespace: nautobot
syncPolicy:
automated:
selfHeal: true
3 changes: 1 addition & 2 deletions components/01-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ kubectl --namespace nautobot \
--dry-run \
-o yaml \
--type Opaque \
--from-literal=NAUTOBOT_REDIS_PASSWORD="$(./scripts/pwgen.sh)" \
--from-literal=NAUTOBOT_SECRET_KEY="$(./scripts/pwgen.sh)" \
--from-literal=NAUTOBOT_SUPERUSER_API_TOKEN="$(./scripts/pwgen.sh)" \
--from-literal=NAUTOBOT_SUPERUSER_PASSWORD="$(./scripts/pwgen.sh)" \
Expand All @@ -59,7 +58,7 @@ kubectl --namespace nautobot \
--dry-run \
-o yaml \
--type Opaque \
--from-literal=redis-password="$(yq e '.data.NAUTOBOT_REDIS_PASSWORD' secret-nautobot-env.yaml | base64 -d)" \
--from-literal=redis-password="$(./scripts/pwgen.sh)" \
> secret-nautobot-redis.yaml
```

Expand Down
14 changes: 14 additions & 0 deletions components/08-nautobot-redis/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmGlobals:
chartHome: ../../charts/
helmCharts:
- name: redis
includeCRDs: true
namespace: nautobot
valuesFile: values.yaml
releaseName: nautobot-redis
version: 18.12.1
repo: https://charts.bitnami.com/bitnami
3 changes: 3 additions & 0 deletions components/08-nautobot-redis/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auth:
existingSecret: nautobot-redis
existingSecretPasswordKey: redis-password
2 changes: 0 additions & 2 deletions components/09-nautobot/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

# the redis chart that Nautobot brings doesn't create this serviceaccount
resources:
- redis-sa.yaml
# the hack for the helm chart rendered this manually from the branch with
# the following command:
# helm template -n nautobot nautobot ./ -f values.yaml > nautobot-helm_2.0.5-plus-password-ref.yaml
Expand Down
Loading

0 comments on commit 82dbc9c

Please sign in to comment.