Skip to content

Commit 100c549

Browse files
authored
Merge pull request #440 from kmala/charts
feat(charts): Add helm charts for builder
2 parents e753238 + c81c1cf commit 100c549

8 files changed

Lines changed: 263 additions & 0 deletions

charts/builder/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: builder
2+
home: https://github.com/deis/builder
3+
version: <Will be populated by the ci before publishing the chart>
4+
description: Git server and application builder for Deis Workflow.
5+
maintainers:
6+
- name: Deis Team
7+
email: engineering@deis.com
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: builder-key-auth
5+
labels:
6+
heritage: deis
7+
annotations:
8+
"helm.sh/hook": pre-install
9+
type: Opaque
10+
data:
11+
builder-key: {{ randAlphaNum 64 | b64enc }}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: deis-builder
5+
labels:
6+
heritage: deis
7+
annotations:
8+
component.deis.io/version: {{ .Values.docker_tag }}
9+
spec:
10+
replicas: 1
11+
strategy:
12+
rollingUpdate:
13+
maxSurge: 1
14+
maxUnavailable: 0
15+
type: RollingUpdate
16+
selector:
17+
matchLabels:
18+
app: deis-builder
19+
template:
20+
metadata:
21+
labels:
22+
app: deis-builder
23+
spec:
24+
serviceAccount: deis-builder
25+
containers:
26+
- name: deis-builder
27+
image: quay.io/{{.Values.org}}/builder:{{.Values.docker_tag}}
28+
imagePullPolicy: {{.Values.pull_policy}}
29+
ports:
30+
- containerPort: 2223
31+
name: ssh
32+
- containerPort: 8092
33+
name: healthsrv
34+
{{- if or (.Values.limits_cpu) (.Values.limits_memory)}}
35+
resources:
36+
limits:
37+
{{- if (.Values.limits_cpu) }}
38+
cpu: {{.Values.limits_cpu}}
39+
{{- end}}
40+
{{- if (.Values.limits_memory) }}
41+
memory: {{.Values.limits_memory}}
42+
{{- end}}
43+
{{- end}}
44+
env:
45+
# NOTE(bacongobbler): use deis/registry_proxy to work around Docker --insecure-registry requirements
46+
- name: "DEIS_REGISTRY_SERVICE_HOST"
47+
value: "localhost"
48+
- name: "DEIS_REGISTRY_SERVICE_PORT"
49+
value: "{{ .Values.global.host_port }}"
50+
- name: "HEALTH_SERVER_PORT"
51+
value: "8092"
52+
- name: "EXTERNAL_PORT"
53+
value: "2223"
54+
- name: BUILDER_STORAGE
55+
value: "{{ .Values.global.storage }}"
56+
- name: "DEIS_REGISTRY_LOCATION"
57+
value: "{{ .Values.global.registry_location }}"
58+
- name: "DEIS_REGISTRY_SECRET_PREFIX"
59+
value: "{{ .Values.global.secret_prefix }}"
60+
# Set GIT_LOCK_TIMEOUT to number of minutes you want to wait to git push again to the same repository
61+
- name: "GIT_LOCK_TIMEOUT"
62+
value: "10"
63+
- name: "SLUGBUILDER_IMAGE_NAME"
64+
valueFrom:
65+
configMapKeyRef:
66+
name: slugbuilder-config
67+
key: image
68+
- name: SLUG_BUILDER_IMAGE_PULL_POLICY
69+
valueFrom:
70+
configMapKeyRef:
71+
name: slugbuilder-config
72+
key: pullPolicy
73+
- name: "DOCKERBUILDER_IMAGE_NAME"
74+
valueFrom:
75+
configMapKeyRef:
76+
name: dockerbuilder-config
77+
key: image
78+
- name: DOCKER_BUILDER_IMAGE_PULL_POLICY
79+
valueFrom:
80+
configMapKeyRef:
81+
name: dockerbuilder-config
82+
key: pullPolicy
83+
# This var needs to be passed so that the minio client (https://github.com/minio/mc) will work in Alpine linux
84+
- name: "DOCKERIMAGE"
85+
value: "1"
86+
- name: "DEIS_DEBUG"
87+
value: "false"
88+
- name: "POD_NAMESPACE"
89+
valueFrom:
90+
fieldRef:
91+
fieldPath: metadata.namespace
92+
- name: DEIS_BUILDER_KEY
93+
valueFrom:
94+
secretKeyRef:
95+
name: builder-key-auth
96+
key: builder-key
97+
livenessProbe:
98+
httpGet:
99+
path: /healthz
100+
port: 8092
101+
initialDelaySeconds: 30
102+
timeoutSeconds: 1
103+
readinessProbe:
104+
httpGet:
105+
path: /readiness
106+
port: 8092
107+
initialDelaySeconds: 30
108+
timeoutSeconds: 1
109+
volumeMounts:
110+
- name: builder-key-auth
111+
mountPath: /var/run/secrets/api/auth
112+
readOnly: true
113+
- name: builder-ssh-private-keys
114+
mountPath: /var/run/secrets/deis/builder/ssh
115+
readOnly: true
116+
- name: objectstore-creds
117+
mountPath: /var/run/secrets/deis/objectstore/creds
118+
readOnly: true
119+
volumes:
120+
- name: builder-key-auth
121+
secret:
122+
secretName: builder-key-auth
123+
- name: builder-ssh-private-keys
124+
secret:
125+
secretName: builder-ssh-private-keys
126+
- name: objectstore-creds
127+
secret:
128+
secretName: objectstorage-keyfile
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: builder-ssh-private-keys
5+
labels:
6+
heritage: deis
7+
annotations:
8+
"helm.sh/hook": pre-install
9+
type: Opaque
10+
data:
11+
ssh-host-rsa-key: "{{genPrivateKey "rsa" | b64enc}}"
12+
ssh-host-dsa-key: "{{genPrivateKey "dsa" | b64enc}}"
13+
ssh-host-ecdsa-key: "{{genPrivateKey "ecdsa" | b64enc}}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: deis-builder
5+
labels:
6+
heritage: deis
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: deis-builder
5+
labels:
6+
heritage: deis
7+
spec:
8+
ports:
9+
- name: ssh
10+
port: 2222
11+
targetPort: 2223
12+
selector:
13+
app: deis-builder
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: objectstorage-keyfile
5+
labels:
6+
heritage: deis
7+
annotations:
8+
deis.io/objectstorage: "{{ .Values.global.storage }}"
9+
type: Opaque
10+
data: {{ if eq .Values.global.storage "gcs"}}
11+
key.json: {{.Values.gcs.key_json | b64enc}}
12+
builder-bucket: {{.Values.gcs.builder_bucket | b64enc }}{{ else if eq .Values.global.storage "azure"}}
13+
accountname: {{.Values.azure.accountname | b64enc }}
14+
accountkey: {{ .Values.azure.accountkey | b64enc }}
15+
builder-container: {{ .Values.azure.builder_container | b64enc }}{{ else if eq .Values.global.storage "s3"}}
16+
accesskey: {{ .Values.s3.accesskey | b64enc }}
17+
secretkey: {{ .Values.s3.secretkey | b64enc }}
18+
region: {{ .Values.s3.region | b64enc }}
19+
builder-bucket: {{ .Values.s3.builder_bucket | b64enc }}{{ else if eq .Values.global.storage "swift"}}
20+
username: {{ .swift.username | b64enc }}
21+
password: {{ .swift.password | b64enc }}
22+
authurl: {{ .swift.authurl | b64enc }}
23+
tenant: {{ .swift.tenant | b64enc }}
24+
authversion: {{ .swift.authversion | b64enc }}
25+
builder-container: {{ .swift.builder_container | b64enc }}{{else if eq .Values.global.storage "minio"}}
26+
accesskey: OFRaUlkySlJXTVBUNlVNWFI2STU=
27+
secretkey: Z2JzdHJPdm90TU1jZzJzTWZHVWhBNWE2RXQvRUk1QUx0SUhzb2JZaw=={{ end }}

charts/builder/values.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
org: "deisci"
2+
pull_policy: "Always"
3+
docker_tag: canary
4+
# limits_cpu: "100m"
5+
# limits_memory: "50Mi"
6+
7+
global:
8+
# Set the storage backend
9+
#
10+
# Valid values are:
11+
# - s3: Store persistent data in AWS S3 (configure in S3 section)
12+
# - azure: Store persistent data in Azure's object storage
13+
# - gcs: Store persistent data in Google Cloud Storage
14+
# - minio: Store persistent data on in-cluster Minio server
15+
storage: minio
16+
17+
# Set the location of Workflow's Registry
18+
#
19+
# Valid values are:
20+
# - on-cluster: Run registry within the Kubernetes cluster
21+
# - off-cluster: Use registry outside the Kubernetes cluster (example: dockerhub,quay.io,self-hosted)
22+
# - ecr: Use Amazon's ECR
23+
# - gcr: Use Google's GCR
24+
registry_location: "on-cluster"
25+
# The host port to which registry proxy binds to
26+
host_port: 5555
27+
# Prefix for the imagepull secret created when using private registry
28+
secret_prefix: "private-registry"
29+
30+
s3:
31+
# Your AWS access key. Leave it empty if you want to use IAM credentials.
32+
accesskey: ""
33+
# Your AWS secret key. Leave it empty if you want to use IAM credentials.
34+
secretkey: ""
35+
# Any S3 region
36+
region: "us-west-1"
37+
# Your buckets.
38+
builder_bucket: "your-builder-bucket-name"
39+
40+
azure:
41+
accountname: "YOUR ACCOUNT NAME"
42+
accountkey: "YOUR ACCOUNT KEY"
43+
builder_container: "your-builder-container-name"
44+
45+
gcs:
46+
# key_json is expanded into a JSON file on the remote server. It must be
47+
# well-formatted JSON data.
48+
key_json: ''
49+
builder_bucket: "your-builder-bucket-name"
50+
51+
swift:
52+
username: "Your OpenStack Swift Username"
53+
password: "Your OpenStack Swift Password"
54+
authurl: "Swift auth URL for obtaining an auth token"
55+
# Your OpenStack tenant name if you are using auth version 2 or 3.
56+
tenant: ""
57+
authversion: "Your OpenStack swift auth version"
58+
builder_container: "your-builder-container-name"

0 commit comments

Comments
 (0)