Skip to content

Commit

Permalink
Merge pull request #61 from rackerlabs/bootstrap
Browse files Browse the repository at this point in the history
feat: template the ArgoCD ingress
  • Loading branch information
cardoe authored Apr 23, 2024
2 parents 173bfc1 + 07cbabc commit f02e319
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion apps/operators/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
helm:
releaseName: ingress-nginx
valueFiles:
- $values/bootstrap/phase_2/ingress-nginx/values.yaml
- $values/bootstrap/ingress-nginx/values.yaml
- $secrets/helm-configs/${DEPLOY_NAME}/ingress-nginx.yaml
- repoURL: https://github.com/rackerlabs/understack.git
targetRevision: ${UC_REPO_REF}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: argocd
namespace: argocd
annotations:
cert-manager.io/cluster-issuer: selfsigned-cluster-issuer
cert-manager.io/cluster-issuer: ${DEPLOY_NAME}-cluster-issuer
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
Expand All @@ -19,8 +19,8 @@ spec:
name: argo-cd-argocd-server
port:
name: http
host: argocd.local
host: argocd.${DNS_ZONE}
tls:
- hosts:
- argocd.local
- argocd.${DNS_ZONE}
secretName: argocd-ingress-tls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ kind: Kustomization

resources:
- namespace.yaml
- ingress.yaml

helmGlobals:
chartHome: ../../charts/
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

wait_for_cert_manager() {
local cmd="kubectl apply -f bootstrap/phase_1/cert-manager/cmchecker.yaml --dry-run=server"
local cmd="kubectl apply -f bootstrap/cert-manager/cmchecker.yaml --dry-run=server"
max_tries=10
current_retry=1

Expand All @@ -19,6 +19,10 @@ wait_for_cert_manager() {
echo " done."
}

kubectl kustomize --enable-helm bootstrap/phase_1 | kubectl apply --server-side -f -
kubectl kustomize --enable-helm bootstrap/cert-manager/ | kubectl apply --server-side -f -
wait_for_cert_manager
kubectl kustomize --enable-helm bootstrap/phase_2 | kubectl apply --server-side -f -
kubectl kustomize --enable-helm bootstrap | kubectl apply --server-side -f -
kubectl apply -f bootstrap/cert-manager/issuer-kube-system-self-signed.yaml
export DEPLOY_NAME=selfsigned
export DNS_ZONE=local
cat bootstrap/argocd/ingress.yaml | envsubst | kubectl apply -f -
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- issuer-kube-system-self-signed.yaml
- cert-manager/issuer-kube-system-self-signed.yaml
- ingress-nginx/
- sealed-secrets/
- argocd/
6 changes: 0 additions & 6 deletions bootstrap/phase_1/kustomization.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/gitops-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ If you do not have ArgoCD deployed then you can use the following:

```bash
kubectl kustomize --enable-helm \
https://github.com/rackerlabs/understack/bootstrap/phase_2/argocd/ \
https://github.com/rackerlabs/understack/bootstrap/argocd/ \
| kubectl apply -f -
```

Expand Down
14 changes: 14 additions & 0 deletions scripts/gitops-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,19 @@ for component in keystone dexidp ingress-nginx ironic nautobot; do
fi
done

for cfg in bootstrap/argocd/ingress.yaml; do
basefile=$(basename "${cfg}")
component=$(basename "$(dirname "${cfg}")")
outfile="${UC_DEPLOY_CLUSTER}/${component}/${basefile}"

mkdir -p "${UC_DEPLOY_CLUSTER}/${component}"
if [ ! -f "${outfile}" ]; then
template "${UC_REPO}/${cfg}" "${outfile}"
else
echo "You have ${outfile} already, not overwriting"
fi
done


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

0 comments on commit f02e319

Please sign in to comment.