Skip to content

Commit f9902e7

Browse files
clamoriniere1Asdminonne
authored andcommitted
Improve helm chart and docker delivery (AmadeusITGroup#75)
1 parent fcc2d4f commit f9902e7

File tree

9 files changed

+70
-32
lines changed

9 files changed

+70
-32
lines changed

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ before_install:
2626
script:
2727
- ./hack/run-test-ci.sh
2828
stages:
29+
- name: docker-push
30+
if: type NOT IN (pull_request)
2931
- name: release
3032
if: tag IS present
3133
jobs:
3234
include:
35+
- stage: docker-push
36+
name: docker-build
37+
deploy:
38+
- provider: script
39+
script: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && cd $TRAVIS_BUILD_DIR && make TAG=$TRAVIS_BRANCH push
40+
on:
41+
branch: master
3342
- stage: release
3443
script:
3544
- docker login -u "$DOCKER_USERNAME" p "$DOCKER_PASSWORD"

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ PLUGIN_PATH=./kubectl-plugin
1919

2020
# 0.0 shouldn't clobber any released builds
2121
TAG= latest
22-
#PREFIX = gcr.io/google_containers/${ARTIFACT}
2322
PREFIX = workflowcontroller/${ARTIFACT}
2423

2524
SOURCES := $(shell find $(SOURCEDIR) ! -name "*_test.go" -name '*.go')

charts/workflow-controller/templates/deployment.yaml

+13-13
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ spec:
2525
args: ["--v={{ .Values.logLevel }}"]
2626
resources:
2727
{{ toYaml .Values.resources | indent 12 }}
28-
{{- if .Values.nodeSelector }}
29-
livenessProbe:
30-
httpGet:
31-
path: /live
32-
port: 8086
33-
initialDelaySeconds: 5
34-
periodSeconds: 5
35-
readinessProbe:
36-
httpGet:
37-
path: /ready
38-
port: 8086
39-
periodSeconds: 5
28+
livenessProbe:
29+
httpGet:
30+
path: /live
31+
port: 8086
32+
initialDelaySeconds: 5
33+
periodSeconds: 5
34+
readinessProbe:
35+
httpGet:
36+
path: /ready
37+
port: 8086
38+
periodSeconds: 5
39+
{{- if .Values.nodeSelector }}
4040
nodeSelector:
4141
{{ toYaml .Values.nodeSelector | indent 8 }}
42-
{{- end }}
42+
{{- end }}

charts/workflow-controller/values.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ logLevel: 2
66
apiGroupName: workflow.k8s.io
77
image:
88
registry: ""
9-
pullPolicy: Always
9+
pullPolicy: IfNotPresent
1010
account: "workflowcontroller"
11-
name: ""
12-
tag: ""
11+
tag: master
1312
resources: {}
1413
# We usually recommend not to specify default resources and to leave this as a conscious
1514
# choice for the user. This also increases chances charts run on environments with little

deployment/k8s/workflow-controller-dpl.yml

+11
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ spec:
1818
image: amadeusitgroup/workflow-controller:latest
1919
imagePullPolicy: Always
2020
args: ["--v=2"]
21+
livenessProbe:
22+
httpGet:
23+
path: /live
24+
port: 8086
25+
initialDelaySeconds: 5
26+
periodSeconds: 5
27+
readinessProbe:
28+
httpGet:
29+
path: /ready
30+
port: 8086
31+
periodSeconds: 5

deployment/k8s/workflow-controller-rbac.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ rules:
88
resources:
99
- customresourcedefinitions
1010
verbs: ["*"]
11-
- apiGroups: ["dag.example.com"]
11+
- apiGroups: ["workflow.k8s.io"]
1212
resources:
1313
- workflows
14+
- cronworkflows
15+
- daemonsetjobs
1416
verbs: ["*"]
1517
- apiGroups: ["batch"]
1618
resources:

docs/README.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ $ kubectl create -f .../examples/hello_workflow/workflow.yaml
2727

2828
At this point the workflow-controller will start to handle the jobs.
2929

30-
31-
### in a kubernetes pod
32-
30+
### Simple deployment
3331

3432
To run `workflow-controller` in a Kubernetes pod you should run this command
3533

3634
```shell
37-
$ kubectl create -f .../deployment/k8s/workflow-controller-rbac.yaml
38-
$ kubectl create -f .../deployment/k8s/workflow-controller-dpl.yaml
35+
$ kubectl create -f .../deployment/k8s/workflow-controller-rbac.yaml -n kube-system
36+
$ kubectl create -f .../deployment/k8s/workflow-controller-dpl.yaml -n kube-system
3937
```
4038

4139
Then you may want to test a workflow example like this:
@@ -44,8 +42,22 @@ Then you may want to test a workflow example like this:
4442
$ kubectl create -f .../examples/hello_workflow/workflow.yaml
4543
```
4644

47-
### in an openshift cluster
48-
TODO
45+
## Helm deployment
46+
47+
You can found in the `charts` folder the `workflow-controller` the helm chart for deploying the Kubernetes `workflow-controller` controller.
48+
49+
```shell
50+
$ helm install --name wf charts/workflow-controller
51+
NAME: wf
52+
LAST DEPLOYED: Tue Jan 9 23:41:13 2018
53+
NAMESPACE: default
54+
STATUS: DEPLOYED
55+
56+
RESOURCES:
57+
==> v1beta1/Deployment
58+
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
59+
wf-workflow-controller 1 1 1 0 0s
60+
```
4961

5062

5163
### Developper
@@ -56,7 +68,7 @@ This project is using [goreleaser](https://goreleaser.com/) and an additional sc
5668

5769
For starting the delivery, you need to clone this repository, then:
5870

59-
```bash
71+
```shell
6072
zsh hack/release.sh <version> <remove-git>
6173
```
6274

hack/helm-release.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#!/bin/bash
22

33
if [ -z "$1" ]; then
4-
echo "please provide the version as parameter: ./helm-release.sh <version>\n"
4+
echo "please provide the version as parameter: ./helm-release.sh <version> <chart-name>\n"
5+
exit 1
6+
fi
7+
8+
if [ -z "$2" ]; then
9+
echo "please provide the chart name as parameter: ./helm-release.sh <version> <chart-name>\n"
510
exit 1
611
fi
712

813
cd $(git rev-parse --show-toplevel)
9-
helm package --version "$1" charts/workflow-controller
10-
mv "helm-test-$1.tgz" docs/
14+
sed "s/tag: master/tag: $1/" chart/$2/values.yaml > charts/$2/values.tmp.yaml; mv charts/$2/values.tmp.yaml charts/$2/values.yaml
15+
helm package --version "$1" charts/$2
16+
mv "$2-$1.tgz" "docs/helm-$2-$1.tgz"
17+
git checkout -- charts/$2/values.yaml
1118
helm repo index docs --url https://amadeusitgroup.github.io/workflow-controller/ --merge docs/index.yaml
12-
git add --all docs/
19+
git add --all docs/

hack/release.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ if [ -n "$2" ]; then
1111
GIT_REMOTE=$2
1212
fi
1313

14-
zsh $GIT_ROOT/hack/helm-release.sh $1
14+
zsh $GIT_ROOT/hack/helm-release.sh $1 workflow-controller
1515

1616
# Update CHANGELOG.md file
1717
ssed -i.bak "5i## Release $1\n" CHANGELOG.md
1818

1919
git commit -am "release $1"
2020
git tag -f $1
21-
git push -f --tags $GIT_REMOTE master

0 commit comments

Comments
 (0)