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: use argocd helm chart instead #33

Merged
merged 3 commits into from
Jan 2, 2022
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: 16 additions & 7 deletions bootstrap/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
.POSIX:
.EXPORT_ALL_VARIABLES:

KUBECONFIG = ../metal/kubeconfig.yaml
KUBECONFIG = $(shell pwd)/../metal/kubeconfig.yaml

env ?= "prod"

default: argocd app
default: namespace argocd root

argocd/charts: argocd/Chart.yaml
cd argocd \
&& helm dependency update

namespace:
kubectl create namespace argocd --dry-run=client --output=yaml \
| kubectl apply -f -

.PHONY: argocd
argocd:
kustomize build ./argocd | kubectl apply -f -
argocd: argocd/charts
cd argocd && \
./apply.sh

.PHONY: app
app:
kubectl apply -f ./app/root-${env}.yaml
.PHONY: root
root:
kubectl apply -f ./root/root-${env}.yaml
8 changes: 8 additions & 0 deletions bootstrap/argocd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v2
name: argocd
version: 0.0.0
dependencies:
- name: argo-cd
version: 3.29.4
repository: https://argoproj.github.io/argo-helm

11 changes: 11 additions & 0 deletions bootstrap/argocd/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

helm template \
--include-crds \
--namespace argocd \
argocd . \
| kubectl apply -n argocd -f -

kubectl -n argocd wait --timeout=60s --for condition=Established \
crd/applications.argoproj.io \
crd/applicationsets.argoproj.io
25 changes: 0 additions & 25 deletions bootstrap/argocd/argocd-cm-patch.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions bootstrap/argocd/argocd-cmd-params-cm-patch.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions bootstrap/argocd/ingress.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions bootstrap/argocd/kustomization.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions bootstrap/argocd/namespace.yaml

This file was deleted.

62 changes: 62 additions & 0 deletions bootstrap/argocd/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
argo-cd:
server:
extraArgs:
- --insecure
config:
statusbadge.enabled: 'true'
resource.customizations.health.argoproj.io_Application: |
hs = {}
hs.status = "Progressing"
hs.message = ""
if obj.status ~= nil then
if obj.status.health ~= nil then
hs.status = obj.status.health.status
if obj.status.health.message ~= nil then
hs.message = obj.status.health.message
end
end
end
return hs
resource.customizations.health.argoproj.io_ApplicationSet: |
hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in pairs(obj.status.conditions) do
if condition.type == "ErrorOccurred" and condition.status == "True" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "ResourcesUpToDate" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end
end
end
end
hs.status = "Progressing"
hs.message = ""
return hs
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_MutatingWebhookConfiguration: |
jqPathExpressions:
- '.webhooks[]?.clientConfig.caBundle'
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration: |
jqPathExpressions:
- '.webhooks[]?.failurePolicy'

ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- &host argocd.maibaloc.com
tls:
- secretName: argocd-tls-certificate
hosts:
- *host
metrics:
enabled: true
serviceMonitor:
enabled: true
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 @@ -46,4 +46,23 @@ spec:
path: 'bootstrap/argocd'
repoURL: https://github.com/locmai/humble.git
targetRevision: "{{ .Values.bootstrap.targetRevision }}"
helm:
values: |
argocd:
targetRevision: {{ .Values.global.targetRevision }}

global:
domain: {{ .Values.global.domain }}

ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- &host argocd.{{ .Values.global.domain }}
tls:
- secretName: argocd-tls-certificate
hosts:
- *host
{{- end }}
File renamed without changes.
File renamed without changes.
File renamed without changes.