Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit b22cf49

Browse files
authored
Add Argo CD installation support (#71)
* Add Argo CD installation support * Update the clusterRole ks-devops * Bump the chart version from 0.1.9 to 0.1.10
1 parent 2fff5ce commit b22cf49

9 files changed

Lines changed: 120 additions & 3 deletions

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ you can then do
2020

2121
```bash
2222
helm search repo ks-devops
23+
helm install devops ks-devops/ks-devops --namespace kubesphere-devops-system --create-namespace
24+
```
25+
26+
## Argo CD support
27+
Install it via the following instructions:
28+
29+
```shell
30+
helm repo add argo https://argoproj.github.io/argo-helm
31+
helm install argocd --version 4.4.0 argo/argo-cd --namespace argocd --create-namespace
32+
```
33+
34+
or, you could use the following instrctions to unintall it:
35+
```shell
36+
helm uninstall --namespace argocd argocd
2337
```
2438

2539
## Configuration

charts/ks-devops/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.9
18+
version: 0.1.10
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.6.2
8+
creationTimestamp: null
9+
name: gitrepositories.devops.kubesphere.io
10+
spec:
11+
group: devops.kubesphere.io
12+
names:
13+
kind: GitRepository
14+
listKind: GitRepositoryList
15+
plural: gitrepositories
16+
singular: gitrepository
17+
scope: Namespaced
18+
versions:
19+
- additionalPrinterColumns:
20+
- jsonPath: .spec.server
21+
name: Server
22+
type: string
23+
name: v1alpha3
24+
schema:
25+
openAPIV3Schema:
26+
description: GitRepository is the Schema for the webhook API
27+
properties:
28+
apiVersion:
29+
description: 'APIVersion defines the versioned schema of this representation
30+
of an object. Servers should convert recognized schemas to the latest
31+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
32+
type: string
33+
kind:
34+
description: 'Kind is a string value representing the REST resource this
35+
object represents. Servers may infer this from the endpoint the client
36+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
37+
type: string
38+
metadata:
39+
type: object
40+
spec:
41+
description: GitRepositorySpec represents the desired state of a GitRepository
42+
properties:
43+
provider:
44+
type: string
45+
secret:
46+
description: SecretReference represents a Secret Reference. It has
47+
enough information to retrieve secret in any namespace
48+
properties:
49+
name:
50+
description: Name is unique within a namespace to reference a
51+
secret resource.
52+
type: string
53+
namespace:
54+
description: Namespace defines the space within which the secret
55+
name must be unique.
56+
type: string
57+
type: object
58+
url:
59+
type: string
60+
webhooks:
61+
items:
62+
description: LocalObjectReference contains enough information to
63+
let you locate the referenced object inside the same namespace.
64+
properties:
65+
name:
66+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
67+
TODO: Add other useful fields. apiVersion, kind, uid?'
68+
type: string
69+
type: object
70+
type: array
71+
type: object
72+
type: object
73+
served: true
74+
storage: true
75+
subresources: {}
76+
status:
77+
acceptedNames:
78+
kind: ""
79+
plural: ""
80+
conditions: []
81+
storedVersions: []

charts/ks-devops/crds/gitops.kubesphere.io_applications.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
properties:
3939
argoApp:
4040
description: ArgoApplication is a definition of Argo Application resource.
41+
Those fields simply are copied from the argo-cd project
4142
properties:
4243
operation:
4344
description: Operation contains information about a requested
@@ -455,7 +456,6 @@ spec:
455456
type: object
456457
spec:
457458
description: ArgoApplicationSpec represents an ArgoCD Application
458-
The fields simply are copied from the argo-cd project
459459
properties:
460460
destination:
461461
description: Destination is a reference to the target Kubernetes

charts/ks-devops/templates/deployment-apiserver.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ spec:
5858
securityContext:
5959
{{- toYaml .Values.securityContext | nindent 12 }}
6060
image: "{{ .Values.image.registry }}/{{ .Values.image.apiserver.repository }}:{{ .Values.image.apiserver.tag | default .Chart.AppVersion }}"
61+
{{- if .Values.argocd.enabled }}
62+
args:
63+
- --argocd-namespace={{ .Values.argocd.namespace }}
64+
{{- end}}
6165
imagePullPolicy: {{ .Values.image.pullPolicy }}
6266
ports:
6367
- containerPort: 9090

charts/ks-devops/templates/deployment-controller.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ spec:
4747
securityContext:
4848
{{- toYaml .Values.securityContext | nindent 12 }}
4949
image: "{{ .Values.image.registry }}/{{ .Values.image.controller.repository }}:{{ .Values.image.controller.tag | default .Chart.AppVersion }}"
50+
{{- if .Values.argocd.enabled }}
51+
args:
52+
- --enabled-controllers
53+
- argocd=true
54+
- --argocd-namespace={{ .Values.argocd.namespace }}
55+
{{- end}}
5056
imagePullPolicy: {{ .Values.image.pullPolicy }}
5157
resources:
5258
{{- toYaml .Values.resources | nindent 12 }}

charts/ks-devops/templates/serviceaccount.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ rules:
5151
- secrets
5252
verbs:
5353
- create
54+
- delete
5455
- get
5556
- list
57+
- patch
5658
- update
5759
- watch
5860
- apiGroups:
@@ -69,6 +71,7 @@ rules:
6971
- applications
7072
verbs:
7173
- create
74+
- delete
7275
- get
7376
- list
7477
- update
@@ -156,6 +159,8 @@ rules:
156159
resources:
157160
- devopsprojects
158161
verbs:
162+
- create
163+
- delete
159164
- get
160165
- list
161166
- update
@@ -165,8 +170,11 @@ rules:
165170
resources:
166171
- gitrepositories
167172
verbs:
173+
- create
174+
- delete
168175
- get
169176
- list
177+
- patch
170178
- update
171179
- watch
172180
- apiGroups:

charts/ks-devops/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ s2i:
9595

9696
jenkins:
9797
enabled: true
98+
99+
argocd:
100+
enabled: true
101+
namespace: argocd

hack/fetch-crds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
crds=("devops.kubesphere.io_devopsprojects.yaml devops.kubesphere.io_pipelines.yaml devops.kubesphere.io_pipelineruns.yaml devops.kubesphere.io_templates.yaml devops.kubesphere.io_clustertemplates.yaml gitops.kubesphere.io_applications.yaml")
3+
crds=("devops.kubesphere.io_devopsprojects.yaml devops.kubesphere.io_pipelines.yaml devops.kubesphere.io_pipelineruns.yaml devops.kubesphere.io_templates.yaml devops.kubesphere.io_clustertemplates.yaml gitops.kubesphere.io_applications.yaml devops.kubesphere.io_gitrepositories.yaml")
44
for crd in $crds
55
do
66
curl -sSL -o charts/ks-devops/crds/$crd https://ghproxy.com/https://raw.githubusercontent.com/kubesphere/ks-devops/master/config/crd/bases/$crd

0 commit comments

Comments
 (0)