-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathk8s-install.sh
38 lines (34 loc) · 1.03 KB
/
k8s-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
DEVBOX_HOSTNAME=${DEVBOX_HOSTNAME:-dev.localhost}
# Create namespace argocd if not exists
kubectl create namespace argocd --dry-run=client -o yaml | kubectl apply -f -
# Deploy ArgoCD with Kustomize
kubectl -n argocd apply -k manifest/base
# Create IngressRoute with dynamic hostname
# see https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#traefik-v22
cat <<EOF | kubectl -n argocd apply -f -
# https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#ingressroute-crd
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: argocd-server
namespace: argocd
spec:
entryPoints:
- web
- websecure
routes:
- kind: Rule
match: Host(\`argocd.$DEVBOX_HOSTNAME\`)
priority: 10
services:
- name: argocd-server
port: 80
- kind: Rule
match: Host(\`argocd.$DEVBOX_HOSTNAME\`) && Headers(\`Content-Type\`, \`application/grpc\`)
priority: 11
services:
- name: argocd-server
port: 80
scheme: h2c
EOF