Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convert nautobot to AppSet #213

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions apps/app-of-apps.yaml

This file was deleted.

39 changes: 36 additions & 3 deletions apps/appsets/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,42 @@ spec:
<<: *uc_component
path: 'components/undersync'
- component: nautobot
source:
<<: *uc_component
path: 'components/nautobot'
sources:
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
path: 'components/nautobot'
ref: understack
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
ref: secrets
path: 'secrets/{{.name}}'
directory:
include: 'secret-nautobot.yaml'
exclude: 'secret-nautobot-sso-dex.yaml'
- repoURL: https://nautobot.github.io/helm-charts/
chart: nautobot
targetRevision: 2.1.0
helm:
releaseName: nautobot
valuesObject:
ingress:
annotations:
cert-manager.io/cluster-issuer: '{{.name }}-cluster-issuer'
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
hostname: 'nautobot.{{index .metadata.annotations "dns_zone" }}'
nautobot:
extraEnvVars:
- name: SOCIAL_AUTH_OIDC_OIDC_ENDPOINT
value: 'https://dex.{{index .metadata.annotations "dns_zone" }}'
valueFiles:
- $understack/components/nautobot/nautobot-values.yaml
- $secrets/helm-configs/{{.name}}/nautobot.yaml
ignoreMissingValueFiles: true
fileParameters:
- name: nautobot.config
# until ArgoCD 2.13.0 is released we cannot use a reference
# path: $understack/components/nautobot/nautobot_config.py
path: 'https://raw.githubusercontent.com/rackerlabs/understack/{{index .metadata.annotations "uc_repo_ref" }}/components/nautobot/nautobot_config.py'
- component: argo
source:
<<: *uc_component
Expand Down
29 changes: 0 additions & 29 deletions apps/components/argo-workflows-templates.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions apps/components/kustomization.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions apps/components/nautobot.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions apps/components/openstack-admin-client.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions components/nautobot/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resources:
helmCharts:
- name: redis
repo: https://charts.bitnami.com/bitnami
version: 18.12.1
version: 18.19.4
namespace: nautobot
releaseName: nautobot-redis
releaseName: nautobot
valuesFile: redis-values.yaml
12 changes: 0 additions & 12 deletions components/nautobot/values.tpl.yaml

This file was deleted.

1 change: 0 additions & 1 deletion docs/deploy-guide/gitops-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ kubectl -n argocd apply -f "${UC_DEPLOY}/secrets/${DEPLOY_NAME}/argocd/secret-de
Finally run the following to have ArgoCD deploy the system:

```bash
kubectl apply -f "${UC_DEPLOY}/clusters/${DEPLOY_NAME}/app-of-apps.yaml"
# from your understack checkout
kubectl apply -f apps/cluster-setup.yaml
```
Expand Down
15 changes: 1 addition & 14 deletions scripts/gitops-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,9 @@ export DEPLOY_NAME
export UC_REPO_REF="${UC_REPO_REF:-HEAD}"
export UC_DEPLOY_REF="${UC_DEPLOY_REF:-HEAD}"

for part in operators components; do
echo "Creating ${part} configs"
mkdir -p "${UC_DEPLOY_CLUSTER}/${part}"
for tmpl in $(find "${UC_REPO_APPS}/${part}" -type f); do
outfile=$(basename "${tmpl}")
template "${tmpl}" "${UC_DEPLOY_CLUSTER}/${part}/${outfile}"
done
rm -rf "${UC_DEPLOY_CLUSTER}/${part}/kustomization.yaml"
done

# create helm-configs directory for values.yaml overrides
mkdir -p "${UC_DEPLOY_HELM_CFG}"
for component in dex nautobot; do
for component in dex; do
helmvals="${UC_DEPLOY_HELM_CFG}/${component}.yaml"
if [ -f "${helmvals}" ]; then
echo "You have ${helmvals} already, not overwriting"
Expand All @@ -83,6 +73,3 @@ for component in dex nautobot; do
echo "# add your values.yaml overrides for the helm chart here" > "${helmvals}"
fi
done

echo "Creating app-of-apps config"
template "${UC_REPO_APPS}/app-of-apps.yaml" "${UC_DEPLOY_CLUSTER}/app-of-apps.yaml"
Loading