Skip to content

Commit a0cdadb

Browse files
committed
Support chart repo crd
1 parent 99775c1 commit a0cdadb

38 files changed

+1098
-85
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
captain
22
.kube
33
.helm
4-
artifacts
54
docs
65

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.idea/
2-
captain
2+
/captain
33
.helm/
44
.kube/
55
artifacts/coverage.out

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
FROM golang:1.12.4
22

3-
COPY . $GOPATH/src/alauda.io/captain
4-
WORKDIR $GOPATH/src/alauda.io/captain
3+
COPY . $GOPATH/src/github.com/alauda/captain
4+
WORKDIR $GOPATH/src/github.com/alauda/captain
55
RUN make build
66

77
FROM index.alauda.cn/alaudaorg/alaudabase-alpine-run:alpine3.9.3
88

99
WORKDIR /captain
1010

11-
COPY --from=0 /go/src/alauda.io/captain/captain /captain/
12-
COPY hack/run.sh /captain/run.sh
13-
RUN chmod a+x /captain/captain /captain/run.sh
11+
COPY --from=0 /go/src/github.com/alauda/captain/captain /captain/
12+
COPY artifacts/helm/repositories.yaml /captain/.helm/repository/
13+
RUN chmod a+x /captain/captain
1414

15-
ENTRYPOINT ["/captain/run.sh"]
15+
16+
# ENTRYPOINT ["/captain/run.sh"]
1617
CMD ["/captain/captain"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ released yet, we add some little medication to help create this controller. Of c
1414

1515
## Features
1616
* HelmRequest and Release CRD, namespace based
17+
* ChartRepo CRD
1718
* Multi cluster support based on [https://github.com/kubernetes/cluster-registry](https://github.com/kubernetes/cluster-registry)
1819
* Dependency check for HelmRequest (between HelmRequests)
1920
* `valuesFrom` support, also use ConfigMap or Secret to store values
@@ -54,6 +55,7 @@ For the detailed explain and advanced usage, please check the documentation belo
5455
* [How captain works](./docs/captain.md)
5556
* [HelmRequest CRD](./docs/helmrequest.md)
5657
* [Release CRD](./docs/release.md)
58+
* [ChartRepo CRD](./docs/chartrepo.md)
5759

5860

5961

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: app.alauda.io/v1alpha1
2+
kind: ChartRepo
3+
metadata:
4+
name: alauda
5+
spec:
6+
url: https://alauda.github.io/charts
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: app.alauda.io/v1alpha1
2+
kind: ChartRepo
3+
metadata:
4+
name: stable
5+
spec:
6+
url: https://kubernetes-charts.storage.googleapis.com

charts/captain/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: captain
22
appVersion: "2.0"
3-
version: v0.8.0
3+
version: v0.9.0
44
description: A Helm3 Controller
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: chartrepos.app.alauda.io
5+
spec:
6+
group: app.alauda.io
7+
version: v1alpha1
8+
names:
9+
kind: ChartRepo
10+
listKind: ChartRepoList
11+
plural: chartrepos
12+
singular: chartrepo
13+
shortNames:
14+
- ctr
15+
additionalPrinterColumns:
16+
- name: URL
17+
type: string
18+
description: The url of this chart repo
19+
JSONPath: .spec.url
20+
- name: Phase
21+
type: string
22+
description: The phase of this ChartRepo
23+
JSONPath: .status.phase
24+
- name: Age
25+
type: date
26+
JSONPath: .metadata.creationTimestamp
27+
scope: Namespaced
28+
validation:
29+
# openAPIV3Schema is the schema for validating custom objects.
30+
openAPIV3Schema:
31+
properties:
32+
spec:
33+
required:
34+
- url

charts/captain/templates/configmap.yaml

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

charts/captain/templates/deployment.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,16 @@ spec:
1717
image: "{{ .Values.global.images.captain.repository }}:{{ .Values.global.images.captain.tag }}"
1818
terminationMessagePolicy: File
1919
imagePullPolicy: {{ .Values.image.policy }}
20-
args:
20+
command:
2121
- /captain/captain
2222
- -cluster-namespace={{ .Values.namespace }}
23+
- -chartrepo-namespace={{ .Values.namespace }}
2324
resources:
2425
{{ toYaml .Values.resources | indent 12 }}
2526
volumeMounts:
26-
- name: config-volume
27-
mountPath: /tmp/repositories.yaml
28-
subPath: repositories.yaml
2927
- name: certs
3028
mountPath: /tmp/k8s-webhook-server/serving-certs
3129
volumes:
32-
- name: config-volume
33-
configMap:
34-
name: captain
3530
- name: certs
3631
secret:
3732
optional: true

0 commit comments

Comments
 (0)