-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Experiment with helm library chart * Add ec-service label * Update _apps.tpl Fix ec-service label * Create argocd-apps schema * Fix broken ec-service label * Rename argo label * Remove parameter override --------- Co-authored-by: Giles Knap <[email protected]>
- Loading branch information
1 parent
2374c00
commit fed07ae
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v2 | ||
name: argocd-apps | ||
description: | | ||
A chart for creating Argocd managed apps for ec services. | ||
type: library | ||
|
||
version: 3.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{- define "ec-helm-charts.argocd-apps" -}} | ||
{{- $currentScope := . -}} | ||
{{- range $service, $settings := .Values.services }} | ||
{{- /* Make sure settings is an empty dict if it is currently nil */ -}} | ||
{{ $settings := default dict $settings -}} | ||
{{ if ne $settings.removed true }} | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: {{ $service }} | ||
namespace: {{ $currentScope.Release.Namespace }} | ||
labels: | ||
ec_service: {{ eq $settings.ec_service true | ternary true false | quote }} | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: {{ default $currentScope.Release.Namespace $currentScope.Values.project }} | ||
destination: | ||
namespace: {{ $currentScope.Values.destination.namespace }} | ||
name: {{ $currentScope.Values.destination.name }} | ||
source: | ||
repoURL: {{ default $currentScope.Values.source.repoURL $settings.repoURL }} | ||
path: services/{{ $service }} | ||
targetRevision: {{ default $currentScope.Values.source.targetRevision $settings.targetRevision }} | ||
helm: | ||
version: v3 | ||
valueFiles: | ||
- ../values.yaml | ||
- values.yaml | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
# don't restart pods unless there has been a change | ||
- ApplyOutOfSyncOnly=true | ||
- RespectIgnoreDifferences=true | ||
--- | ||
{{ end }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"properties": { | ||
"destination": { | ||
"description": "The desired Kubernetes cluster for deployment", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "The name of the Kubernetes cluster" | ||
}, | ||
"namespace": { | ||
"type": "string", | ||
"description": "The target namespace" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"source": { | ||
"description": "The desired specification of the services to be deployed", | ||
"properties": { | ||
"targetRevision": { | ||
"type": "string", | ||
"description": "Optional override for targetRevision" | ||
}, | ||
"repoURL": { | ||
"type": "string", | ||
"description": "The git repo hosting the services repository (helm chart path must be services/<service>)" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"services": { | ||
"type": "object", | ||
"patternProperties": { | ||
"^.*$": { | ||
"type": ["object", "null"], | ||
"properties": { | ||
"targetRevision": { | ||
"type": "string", | ||
"description": "Override for targetRevision" | ||
}, | ||
"repoURL": { | ||
"type": "string", | ||
"description": "Override for repoURL" | ||
}, | ||
"ec_service": { | ||
"type": "boolean", | ||
"description": "Manage a service as an Epics container", | ||
"default": "False" | ||
}, | ||
"enabled": { | ||
"type": "boolean", | ||
"description": "Start a service", | ||
"default": "True" | ||
}, | ||
"removed": { | ||
"type": "boolean", | ||
"description": "Remove the service from the cluster", | ||
"default": "False" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"description": "A service instance" | ||
} | ||
} | ||
}, | ||
"project": { | ||
"description": "A target Argocd Project", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"project", | ||
"destination", | ||
"source" | ||
], | ||
"title": "Values", | ||
"type": "object" | ||
} | ||
|