diff --git a/Chart.lock b/Chart.lock new file mode 100644 index 0000000..88397e8 --- /dev/null +++ b/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: argo-cd + repository: https://argoproj.github.io/argo-helm + version: 5.29.1 +digest: sha256:bc009287f8e46edcddb1d36d4e6865080d92e97b6572ae2fd4d553d5e41cd2a2 +generated: "2023-04-22T12:59:51.842278-05:00" diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 0000000..2f8d3f6 --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: argo1 +description: A Helm chart for your management ArgoCD of your management ArgoCD + +type: application +version: 0.1.0 +appVersion: 0.1.0 + +dependencies: +- name: argo-cd + version: "5.29.1" + repository: "https://argoproj.github.io/argo-helm" + diff --git a/blah.yaml b/blah.yaml new file mode 100644 index 0000000..8ae76ec --- /dev/null +++ b/blah.yaml @@ -0,0 +1,19 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: concourse + namespace: argocd +spec: + project: default + source: + repoURL: 'https://concourse-charts.storage.googleapis.com/' + targetRevision: 17.1.1 + helm: + values: |- + clusterName: Concourse + secrets: + create: true + chart: concourse + destination: + namespace: concourse + name: in-cluster diff --git a/charts/argo-cd-5.29.1.tgz b/charts/argo-cd-5.29.1.tgz new file mode 100644 index 0000000..ce12a8a Binary files /dev/null and b/charts/argo-cd-5.29.1.tgz differ diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..055240f --- /dev/null +++ b/deploy.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +TARGETNS="$(yq -r .spec.destination.namespace application.yaml)" +ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')" + +( + set -e + jq -n --args '{"apiVersion":"v1","kind":"Namespace","metadata":{"name": $ARGS.positional[0]}}' "$TARGETNS" | kubectl apply -f - + + [ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace argocd + helm upgrade -i --create-namespace -n argocd argocd argo/argo-cd #-f values.yaml + kubectl wait -n argocd deploy/argocd-server --for=condition=available + kubectl apply -f application.yaml + # + argocd --core app sync argocd +) + +[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS" diff --git a/poop/_helpers.tpl b/poop/_helpers.tpl new file mode 100644 index 0000000..101ad8a --- /dev/null +++ b/poop/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "argo1.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "argo1.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "argo1.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "argo1.labels" -}} +helm.sh/chart: {{ include "argo1.chart" . }} +{{ include "argo1.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "argo1.selectorLabels" -}} +app.kubernetes.io/name: {{ include "argo1.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "argo1.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "argo1.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/poop/argocd.yaml b/poop/argocd.yaml new file mode 100644 index 0000000..960ec40 --- /dev/null +++ b/poop/argocd.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: "{{ .Release.Name }}" + namespace: "{{ .Release.Namespace }}" +spec: + project: default + source: + repoURL: "{{ .Chart.dependencies[0].repository }}" + targetRevision: "{{ .Chart.dependencies[0].version }}" + chart: "{{ .Chart.dependencies[0].name }}" + helm: + values: | + {{ .Values.argocd.values | nindent 12 }} + destination: + namespace: "{{ .Values.argocd.namespace }}" + name: in-cluster diff --git a/values.yaml b/values.yaml new file mode 100644 index 0000000..92de2e6 --- /dev/null +++ b/values.yaml @@ -0,0 +1,24 @@ +argo-cd: + configs: + params: + "server.insecure": "true" + + controller: + replicas: 2 + + server: + ingress: + enabled: true + hosts: &hhosts + - argocd.strudelline.net + tls: + - hosts: *hhosts + secretName: wildcard-tls + ingressGrpc: + enabled: true + hosts: &ghosts + - grpc-argocd.strudelline.net + tls: + - hosts: *ghosts + secretName: wildcard-tls +