-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,098 additions
and
85 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
captain | ||
.kube | ||
.helm | ||
artifacts | ||
docs | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.idea/ | ||
captain | ||
/captain | ||
.helm/ | ||
.kube/ | ||
artifacts/coverage.out |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
FROM golang:1.12.4 | ||
|
||
COPY . $GOPATH/src/alauda.io/captain | ||
WORKDIR $GOPATH/src/alauda.io/captain | ||
COPY . $GOPATH/src/github.com/alauda/captain | ||
WORKDIR $GOPATH/src/github.com/alauda/captain | ||
RUN make build | ||
|
||
FROM index.alauda.cn/alaudaorg/alaudabase-alpine-run:alpine3.9.3 | ||
|
||
WORKDIR /captain | ||
|
||
COPY --from=0 /go/src/alauda.io/captain/captain /captain/ | ||
COPY hack/run.sh /captain/run.sh | ||
RUN chmod a+x /captain/captain /captain/run.sh | ||
COPY --from=0 /go/src/github.com/alauda/captain/captain /captain/ | ||
COPY artifacts/helm/repositories.yaml /captain/.helm/repository/ | ||
RUN chmod a+x /captain/captain | ||
|
||
ENTRYPOINT ["/captain/run.sh"] | ||
|
||
# ENTRYPOINT ["/captain/run.sh"] | ||
CMD ["/captain/captain"] |
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
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,6 @@ | ||
apiVersion: app.alauda.io/v1alpha1 | ||
kind: ChartRepo | ||
metadata: | ||
name: alauda | ||
spec: | ||
url: https://alauda.github.io/charts |
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,6 @@ | ||
apiVersion: app.alauda.io/v1alpha1 | ||
kind: ChartRepo | ||
metadata: | ||
name: stable | ||
spec: | ||
url: https://kubernetes-charts.storage.googleapis.com |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: captain | ||
appVersion: "2.0" | ||
version: v0.8.0 | ||
version: v0.9.0 | ||
description: A Helm3 Controller |
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,34 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: chartrepos.app.alauda.io | ||
spec: | ||
group: app.alauda.io | ||
version: v1alpha1 | ||
names: | ||
kind: ChartRepo | ||
listKind: ChartRepoList | ||
plural: chartrepos | ||
singular: chartrepo | ||
shortNames: | ||
- ctr | ||
additionalPrinterColumns: | ||
- name: URL | ||
type: string | ||
description: The url of this chart repo | ||
JSONPath: .spec.url | ||
- name: Phase | ||
type: string | ||
description: The phase of this ChartRepo | ||
JSONPath: .status.phase | ||
- name: Age | ||
type: date | ||
JSONPath: .metadata.creationTimestamp | ||
scope: Namespaced | ||
validation: | ||
# openAPIV3Schema is the schema for validating custom objects. | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
required: | ||
- url |
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ global: | |
images: | ||
captain: | ||
repository: alaudapublic/captain | ||
tag: v0.8.0 | ||
tag: v0.9.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
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,62 @@ | ||
## ChartRepo | ||
|
||
`ChartRepo` represents a helm repository, where helm client can retrieve and upload helm charts. | ||
The definition is quite simple, For example, the most simplest ones is : | ||
|
||
```yaml | ||
apiVersion: app.alauda.io/v1alpha1 | ||
kind: ChartRepo | ||
metadata: | ||
name: stable | ||
namespace: captain | ||
spec: | ||
url: https://kubernetes-charts.storage.googleapis.com | ||
``` | ||
* `metadata.name`: the name of this repo | ||
* `metadata.namespace`: Captain will only read ChartRepo resources from one namespace, | ||
default to `captain`, and can be customized in helm values (`.namespace`) | ||
* `spec.url`: the url of this repo | ||
|
||
After created, we can use `kubectl` to checkout the repo list | ||
|
||
```bash | ||
root@VM-16-12-ubuntu:/home/ubuntu# kubectl get ctr -n captain | ||
NAME URL PHASE AGE | ||
stable https://kubernetes-charts.storage.googleapis.com Synced 21m | ||
``` | ||
|
||
The output is very similar to `helm repo list`. | ||
|
||
### Basic Auth | ||
Of course ,many repos need auth support. Currently, `ChartRepo` has support basic auth by specify | ||
a secret resource in the spec: | ||
|
||
```yaml | ||
apiVersion: app.alauda.io/v1alpha1 | ||
kind: ChartRepo | ||
metadata: | ||
name: new | ||
namespace: captain | ||
spec: | ||
url: <url> | ||
secret: | ||
name: new | ||
``` | ||
|
||
* `spec.secret.name`: name of the secret | ||
* `spec.secret.namespace`: namespace of the secret, an optional field, default to the same namespace as `ChartRepo` | ||
|
||
Then, all you need is a secret which contains `username` and `password` data: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
data: | ||
password: MndiNEUxaXlkUmo3 | ||
username: N0RPOVFvTHREeDFn | ||
kind: Secret | ||
metadata: | ||
name: new | ||
namespace: captain | ||
type: Opaque | ||
``` |
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
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
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
Oops, something went wrong.