Skip to content

Commit fcbcc6f

Browse files
committed
wip
1 parent dac4d61 commit fcbcc6f

File tree

13 files changed

+192
-376
lines changed

13 files changed

+192
-376
lines changed

helm/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

helm/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: argo-cd
3+
repository: https://argoproj.github.io/argo-helm
4+
version: 4.2.2
5+
digest: sha256:1a53438d8db48f4a1f29c5406c437ea38ed7ff71940ac792391a27b9f3262335
6+
generated: "2022-03-23T15:49:42.434404+02:00"

helm/Chart.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: csdp-installer
3+
description: A Helm chart used for installing a CSDP runtime
4+
type: application
5+
version: 0.1.0
6+
appVersion: v0.0.4
7+
8+
dependencies:
9+
- name: argo-cd
10+
repository: https://argoproj.github.io/argo-helm
11+
version: 4.2.2

helm/charts/argo-cd-4.2.2.tgz

98.8 KB
Binary file not shown.

helm/templates/_helpers.tpl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "csdp-installer.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "csdp-installer.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "csdp-installer.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "csdp-installer.labels" -}}
37+
helm.sh/chart: {{ include "csdp-installer.chart" . }}
38+
{{ include "csdp-installer.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "csdp-installer.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "csdp-installer.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}

helm/templates/cm.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: "{{ include "csdp-installer.fullname" . }}-cm"
5+
data:
6+
csdp.url: {{ .Values.csdp.url }}
7+
csdp.token: {{ .Values.csdp.token }}
8+
runtime.name: {{ .Values.csdp.runtime.name }}
9+
runtime.repo: {{ .Values.csdp.runtime.repo }}
10+
runtime.gitToken: {{ .Values.csdp.runtime.gitToken }}
11+
runtime.ingressURL: {{ .Values.csdp.runtime.ingressURL }}
12+
runtime.cluster: {{ .Values.csdp.runtime.cluster }}
Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
apiVersion: batch/v1
22
kind: Job
33
metadata:
4-
name: csdp-installation-job
4+
name: {{ include "csdp-installer.fullname" . }}
5+
labels:
6+
{{- include "csdp-installer.labels" . | nindent 4 }}
57
spec:
6-
ttlSecondsAfterFinished: 600 # stick around for 10m
7-
backoffLimit: 20
8+
ttlSecondsAfterFinished: {{ .Values.csdp.installer.ttlSecondsAfterFinished }}
9+
backoffLimit: {{ .Values.csdp.installer.backoffLimit }}
810
template:
911
metadata:
10-
name: csdp-installation-job
12+
labels:
13+
{{- include "csdp-installer.selectorLabels" . | nindent 8 }}
1114
spec:
12-
serviceAccount: argocd-server
15+
serviceAccount: {{ .Values.csdp.installer.serviceAccount }}
1316
restartPolicy: Never
1417
containers:
1518
- name: csdp-installer
16-
image: csdp-installer
17-
imagePullPolicy: IfNotPresent
19+
image: "{{ .Values.csdp.installer.image.repository }}:{{ .Values.csdp.installer.image.tag | default .Chart.AppVersion }}"
20+
imagePullPolicy: {{ .Values.csdp.installer.imagePullPolicy }}
1821
command:
1922
- bash
2023
args:
@@ -27,67 +30,61 @@ spec:
2730
- name: CSDP_URL
2831
valueFrom:
2932
configMapKeyRef:
30-
name: csdp-installer-cm
33+
name: "{{ include "csdp-installer.fullname" . }}-cm"
3134
key: csdp.url
3235
- name: CSDP_TOKEN
3336
valueFrom:
3437
configMapKeyRef:
35-
name: csdp-installer-cm
38+
name: "{{ include "csdp-installer.fullname" . }}-cm"
3639
key: csdp.token
3740
- name: CSDP_RUNTIME_NAME
3841
valueFrom:
3942
configMapKeyRef:
40-
name: csdp-installer-cm
43+
name: "{{ include "csdp-installer.fullname" . }}-cm"
4144
key: runtime.name
4245
- name: CSDP_RUNTIME_VERSION
4346
valueFrom:
4447
configMapKeyRef:
45-
name: csdp-installer-cm
48+
name: "{{ include "csdp-installer.fullname" . }}-cm"
4649
key: runtime.version
4750
optional: true
4851
- name: CSDP_RUNTIME_REPO
4952
valueFrom:
5053
configMapKeyRef:
51-
name: csdp-installer-cm
54+
name: "{{ include "csdp-installer.fullname" . }}-cm"
5255
key: runtime.repo
5356
- name: CSDP_RUNTIME_GIT_TOKEN
5457
valueFrom:
5558
configMapKeyRef:
56-
name: csdp-installer-cm
59+
name: "{{ include "csdp-installer.fullname" . }}-cm"
5760
key: runtime.gitToken
5861
- name: CSDP_RUNTIME_CLUSTER
5962
valueFrom:
6063
configMapKeyRef:
61-
name: csdp-installer-cm
64+
name: "{{ include "csdp-installer.fullname" . }}-cm"
6265
key: runtime.cluster
6366
- name: CSDP_RUNTIME_INGRESS_URL
6467
valueFrom:
6568
configMapKeyRef:
66-
name: csdp-installer-cm
69+
name: "{{ include "csdp-installer.fullname" . }}-cm"
6770
key: runtime.ingressURL
6871
- name: CSDP_GIT_INTEGRATION_PROVIDER
6972
valueFrom:
7073
configMapKeyRef:
71-
name: csdp-installer-cm
74+
name: "{{ include "csdp-installer.fullname" . }}-cm"
7275
key: gitIntegration.provider
7376
optional: true
7477
- name: CSDP_GIT_INTEGRATION_API_URL
7578
valueFrom:
7679
configMapKeyRef:
77-
name: csdp-installer-cm
80+
name: "{{ include "csdp-installer.fullname" . }}-cm"
7881
key: gitIntegration.apiURL
7982
optional: true
8083
- name: CSDP_GIT_INTEGRATION_TOKEN
8184
valueFrom:
8285
configMapKeyRef:
83-
name: csdp-installer-cm
86+
name: "{{ include "csdp-installer.fullname" . }}-cm"
8487
key: gitIntegration.token
8588
optional: true
86-
8789
resources:
88-
limits:
89-
memory: 256Mi
90-
cpu: "1"
91-
requests:
92-
memory: 128Mi
93-
cpu: "0.2"
90+
{{- toYaml .Values.csdp.installer.resources | nindent 12 }}

helm/values.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
global:
2+
# Controlls argo-cd image
3+
image:
4+
repository: quay.io/codefresh/argocd
5+
tag: v2.1.11-cap-CR-10085
6+
7+
argo-cd:
8+
fullnameOverride: "argocd"
9+
server:
10+
extraArgs:
11+
- --insecure
12+
configEnabled: true
13+
config:
14+
accounts.admin: apiKey,login
15+
timeout.reconciliation: 20s
16+
17+
notifications:
18+
# -- Enable Notifications controller
19+
enabled: false
20+
21+
applicationSet:
22+
enable: true
23+
image:
24+
# -- Repository to use for the application set controller
25+
repository: quay.io/argoproj/argocd-applicationset
26+
# -- Image pull policy for the application set controller
27+
pullPolicy: IfNotPresent
28+
# -- Tag to use for the application set controller
29+
tag: "v0.4.1"
30+
31+
csdp:
32+
# The codefresh platform URL
33+
url: https://g.codefresh.io
34+
# Codefresh API Key
35+
token: TOKEN_HERE
36+
37+
runtime:
38+
# CSDP runtime name
39+
name: demo-runtime
40+
# CSDP runtime installation repo url
41+
repo: https://github.com/example/csdp
42+
# Git authentication token
43+
gitToken: GIT_TOKEN
44+
# Ingress URL that will be used to reach to services inside of the cluster
45+
ingressURL: https://example.com
46+
# Kubernetes cluster address or name that will be used to identify this cluster
47+
cluster: https://kubernetes.docker.internal:6443
48+
49+
# Controlls the spec of the csdp installer job
50+
installer:
51+
image:
52+
repository: quay.io/codefresh/csdp-installer
53+
pullPolicy: IfNotPresent
54+
# Default tag is the chart appVersion
55+
tag: ""
56+
serviceAccount: argocd-server
57+
ttlSecondsAfterFinished: 600
58+
backoffLimit: 20
59+
resources:
60+
limits:
61+
memory: 256Mi
62+
cpu: "1"
63+
requests:
64+
memory: 128Mi
65+
cpu: "0.2"

kustomize/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- https://github.com/codefresh-io/cli-v2.git/manifests/argo-cd?ref=v0.0.291
5-
- ./runtime-installer/resources
5+
- ./runtime-installer.cm.yaml
6+
- ./runtime-installer.job.yaml

kustomize/runtime-installer/Dockerfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)