Skip to content

Commit

Permalink
fix(argocd): create network project
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuquet committed Sep 14, 2024
1 parent 71585bc commit faf88bc
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
19 changes: 18 additions & 1 deletion ansible/roles/k8s/argocd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,24 @@
wait: yes
wait_timeout: 300

- name: Update argocd-cmd-params-cm ConfigMap to set server.insecure= "true"
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
namespace: argocd
data:
server.insecure: "true"

- name: Create Network Project
kubernetes.core.k8s:
state: present
definition: "{{ lookup('file', '../../../../argocd/project-network.yml') | from_yaml }}"

- name: Create Ingress Application
kubernetes.core.k8s:
state: present
definition: "{{ lookup('file', '../../../../argocd/ingress.yml') | from_yaml }}"
definition: "{{ lookup('file', '../../../../argocd/application-ingress.yml') | from_yaml }}"
4 changes: 2 additions & 2 deletions argocd/ingress.yml → argocd/application-ingress.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ingress
name: argocd-ingress
namespace: argocd
spec:
project: argocd
project: network
source:
repoURL: 'https://github.com/gsuquet/homelab.git'
targetRevision: HEAD
Expand Down
15 changes: 15 additions & 0 deletions argocd/project-network.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: network
namespace: argocd
spec:
description: All network related applications
sourceRepos:
- '*'
destinations:
- namespace: kube-system
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: '*'
kind: '*'
16 changes: 13 additions & 3 deletions services/ingress/argocd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: argocd-server
Expand All @@ -8,8 +8,18 @@ spec:
- web
- websecure
routes:
- match: PathPrefix(`/argocd`)
kind: Rule
- kind: Rule
match: PathPrefix(`/argocd`)
priority: 10
services:
- name: argocd-server
port: 80
- kind: Rule
match: PathPrefix(`/argocd`) && Header(`Content-Type`, `application/grpc`)
priority: 11
services:
- name: argocd-server
port: 80
scheme: h2c
tls:
certResolver: default

0 comments on commit faf88bc

Please sign in to comment.