Skip to content

Commit

Permalink
feat: add sandbox argocd deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rochecompaan committed Sep 20, 2024
1 parent 14c520b commit 8c0e1ad
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: kustomize.config.k8s.io/v1beta1
namespace: argocd
resources:
- ../../base/argocd
- ../../base/cert-manager
- ../../base/cloudnative-pg
- ../../base/ingress
- ../../base/local-path-provisioner
- ../../base/reflector
- ../../base/sealed-secrets
- ../../base/traefik
- ../../base/{{ cookiecutter.project_slug }}
kind: Kustomization
patches:
- patch: |-
- op: replace
path: /spec/source/targetRevision
value: develop
- op: replace
path: /spec/source/path
value: argocd/sandbox/ingress
target:
kind: Application
name: ingress
- patch: |-
- op: replace
path: /metadata/name
value: {{ cookiecutter.project_slug }}-sandbox
- op: replace
path: /spec/source/targetRevision
value: develop
- op: replace
path: /spec/source/path
value: k8s/sandbox
- op: replace
path: /spec/destination/namespace
value: {{ cookiecutter.project_slug }}-sandbox
target:
kind: Application
name: {{ cookiecutter.project_slug }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: argocd-sandbox-{{ cookiecutter.project_slug }}-tls
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "3"
spec:
secretName: argocd-sandbox-{{ cookiecutter.project_slug }}-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- argocd.sandbox.{{ cookiecutter.domain_name }}
59 changes: 59 additions & 0 deletions {{cookiecutter.project_slug}}/argocd/sandbox/ingress/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: argocd-sandbox-{{ cookiecutter.project_slug }}
annotations:
argocd.argoproj.io/sync-wave: "2"
namespace: argocd
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: Host(`argocd.sandbox.{{ cookiecutter.domain_name }}`)
priority: 10
services:
- name: argocd-server
port: 80
- kind: Rule
match: Host(`argocd.sandbox.{{ cookiecutter.domain_name }}`) && Headers(`Content-Type`, `application/grpc`)
priority: 11
services:
- name: argocd-server
port: 80
scheme: h2c
tls:
secretName: argocd-sandbox-{{ cookiecutter.project_slug }}-tls
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: http-to-https-redirect
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "5"
spec:
entryPoints:
- web
routes:
- kind: Rule
match: PathPrefix(`/`)
priority: 1
middlewares:
- name: redirect-to-https
services:
- kind: TraefikService
name: noop@internal
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: redirect-to-https
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "5"
spec:
redirectScheme:
scheme: https
permanent: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
resources:
- cert-manager-issuer.yaml
- certificates.yaml
- ingress.yaml
kind: Kustomization

0 comments on commit 8c0e1ad

Please sign in to comment.