Skip to content

Commit 1f57fbd

Browse files
committed
wip
1 parent 28cfe68 commit 1f57fbd

21 files changed

+217
-0
lines changed

csdp/appset.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
annotations:
5+
argocd.argoproj.io/sync-options: PruneLast=true
6+
argocd.argoproj.io/sync-wave: "-2"
7+
creationTimestamp: null
8+
name: csdp
9+
namespace: default # replace
10+
spec:
11+
clusterResourceWhitelist:
12+
- group: "*"
13+
kind: "*"
14+
description: csdp project
15+
destinations:
16+
- namespace: "*"
17+
server: "*"
18+
namespaceResourceWhitelist:
19+
- group: "*"
20+
kind: "*"
21+
sourceRepos:
22+
- "*"
23+
status: {}
24+
25+
---
26+
apiVersion: argoproj.io/v1alpha1
27+
kind: ApplicationSet
28+
metadata:
29+
annotations:
30+
argocd.argoproj.io/sync-wave: "0"
31+
name: csdp
32+
namespace: default # replace
33+
spec:
34+
generators:
35+
- git:
36+
repoURL: https://github.com/codefresh-io/csdp-official-poc.git
37+
revision: ""
38+
directories:
39+
- path: csdp/components/*
40+
requeueAfterSeconds: 15
41+
- git:
42+
files:
43+
- path: csdp/components/**/config_dir.json
44+
repoURL: https://github.com/codefresh-io/csdp-official-poc.git
45+
requeueAfterSeconds: 15
46+
revision: ""
47+
template:
48+
spec:
49+
source:
50+
directory:
51+
exclude: "{{exclude}}"
52+
include: "{{include}}"
53+
recurse: true
54+
template:
55+
metadata:
56+
labels:
57+
app.kubernetes.io/name: "{{path.basenameNormalized}}"
58+
codefresh.io/entity: "component"
59+
codefresh.io/internal: "true"
60+
name: csdp-{{path.basenameNormalized}}
61+
namespace: default # replace
62+
spec:
63+
destination:
64+
namespace: default # replace
65+
server: "https://kubernetes.default.svc"
66+
ignoreDifferences:
67+
- group: argoproj.io
68+
jsonPointers:
69+
- /status
70+
kind: Application
71+
project: csdp
72+
source:
73+
path: csdp/components/{{path.basenameNormalized}}
74+
repoURL: https://github.com/codefresh-io/csdp-official-poc.git
75+
targetRevision: HEAD # replace with runtime version
76+
syncPolicy:
77+
automated:
78+
allowEmpty: true
79+
prune: true
80+
selfHeal: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# allow default service account to read the codefresh-cm configmap
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: codefresh-config-reader
6+
rules:
7+
- apiGroups: [""]
8+
resources: ["configmaps", "secrets"]
9+
resourceNames: ["codefresh-cm", "codefresh-token"]
10+
verbs: ["get"]
11+
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: RoleBinding
15+
metadata:
16+
name: codefresh-config-reader
17+
roleRef:
18+
apiGroup: rbac.authorization.k8s.io
19+
kind: Role
20+
name: codefresh-config-reader
21+
subjects:
22+
- kind: ServiceAccount
23+
name: default
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- https://raw.githubusercontent.com/codefresh-io/argo-cd/release-2.1/manifests/install.yaml
5+
- https://raw.githubusercontent.com/argoproj-labs/applicationset/master/manifests/install.yaml?ref=2c62537a8e5a # TODO: switch to the next release when available
6+
- default-rbac.yaml
7+
images:
8+
- name: quay.io/codefresh/argocd
9+
newName: quay.io/codefresh/argocd
10+
newTag: v2.1.14-cap-10316
11+
12+
# will be effective on argo-cd 2.1
13+
configMapGenerator:
14+
- name: argocd-cm
15+
behavior: merge
16+
literals:
17+
- "timeout.reconciliation=20s"
18+
- "accounts.admin=apiKey,login" # need to be able to generate apikey for generic eventsource
19+
- |
20+
repository.credentials=- passwordSecret:
21+
key: git_token
22+
name: autopilot-secret
23+
url: https://github.com/
24+
usernameSecret:
25+
key: git_username
26+
name: autopilot-secret"
27+
- name: argocd-cmd-params-cm
28+
behavior: merge
29+
literals:
30+
- "server.insecure=true"
31+
32+
patches:
33+
# reset the crbs to `subject.namespace: default`, so that argo-cd will later change them to the actual ns
34+
- target:
35+
group: rbac.authorization.k8s.io
36+
version: v1
37+
kind: ClusterRoleBinding
38+
patch: |-
39+
- op: replace
40+
path: /subjects/0/namespace
41+
value: default
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: EventBus
3+
metadata:
4+
name: codefresh-eventbus
5+
annotations:
6+
argocd.argoproj.io/sync-wave: "2"
7+
spec:
8+
nats:
9+
native:
10+
replicas: 3
11+
auth: token
12+
containerTemplate: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- https://raw.githubusercontent.com/codefresh-io/argo-events/v1.5.5-cap-CR-10290/manifests/install.yaml
5+
- https://raw.githubusercontent.com/codefresh-io/argo-events/v1.5.5-cap-CR-10290/manifests/install-validating-webhook.yaml
6+
- eventbus.yaml
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- https://github.com/codefresh-io/argo-workflows/releases/download/v3.2.6-cap-CR-8697/install.yaml
5+
6+
patches:
7+
# reset the crbs to `subject.namespace: default`, so that argo-cd will later change them to the actual ns
8+
- target:
9+
group: rbac.authorization.k8s.io
10+
version: v1
11+
kind: ClusterRoleBinding
12+
patch: |-
13+
- op: replace
14+
path: /subjects/0/namespace
15+
value: default
16+
17+
- target:
18+
group: apps
19+
version: v1
20+
kind: Deployment
21+
name: argo-server
22+
patch: |-
23+
- op: add
24+
path: /spec/template/spec/containers/0/args/-
25+
value: --auth-mode=server
26+
27+
patchesStrategicMerge:
28+
- |
29+
apiVersion: v1
30+
kind: ConfigMap
31+
metadata:
32+
name: workflow-controller-configmap
33+
data:
34+
# Fields reference can be found here: https://argoproj.github.io/argo-workflows/workflow-controller-configmap.yaml
35+
workflowDefaults: |
36+
spec:
37+
ttlStrategy:
38+
secondsAfterCompletion: 86400
39+
secondsAfterSuccess: 86400
40+
secondsAfterFailure: 86400
41+
podGC:
42+
strategy: OnWorkflowCompletion
43+
labelSelector:
44+
matchLabels:
45+
should-be-deleted: "true"
46+
47+
configMapGenerator:
48+
- name: workflow-controller-configmap
49+
behavior: merge
50+
literals:
51+
- containerRuntimeExecutor=emissary

csdp/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- appset.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)