Skip to content

Commit 5614cf7

Browse files
committed
feat(charts): Add helm charts for registry
1 parent fa9c217 commit 5614cf7

6 files changed

Lines changed: 184 additions & 0 deletions

File tree

charts/registry/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: registry
2+
home: https://github.com/deis/registry
3+
version: <Will be populated by the ci before publishing the chart>
4+
description: Docker registry for Deis Workflow.
5+
maintainers:
6+
- name: Deis Team
7+
email: engineering@deis.com
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{- if eq .Values.global.registry_location "on-cluster" }}
2+
apiVersion: extensions/v1beta1
3+
kind: Deployment
4+
metadata:
5+
name: deis-registry
6+
labels:
7+
heritage: deis
8+
annotations:
9+
component.deis.io/version: {{ .Values.docker_tag }}
10+
spec:
11+
replicas: 1
12+
strategy:
13+
rollingUpdate:
14+
maxSurge: 1
15+
maxUnavailable: 0
16+
type: RollingUpdate
17+
selector:
18+
matchLabels:
19+
app: deis-registry
20+
template:
21+
metadata:
22+
labels:
23+
app: deis-registry
24+
spec:
25+
serviceAccount: deis-registry
26+
containers:
27+
- name: deis-registry
28+
image: quay.io/{{.Values.org}}/registry:{{.Values.docker_tag}}
29+
imagePullPolicy: {{.Values.pull_policy}}
30+
{{- if or (.Values.limits_cpu) (.Values.limits_memory)}}
31+
resources:
32+
limits:
33+
{{- if (.Values.limits_cpu) }}
34+
cpu: {{.Values.limits_cpu}}
35+
{{- end}}
36+
{{- if (.Values.limits_memory) }}
37+
memory: {{.Values.limits_memory}}
38+
{{- end}}
39+
{{- end}}
40+
livenessProbe:
41+
httpGet:
42+
path: /v2/
43+
port: 5000
44+
initialDelaySeconds: 1
45+
timeoutSeconds: 1
46+
readinessProbe:
47+
httpGet:
48+
path: /v2/
49+
port: 5000
50+
initialDelaySeconds: 1
51+
timeoutSeconds: 1
52+
env:
53+
- name: REGISTRY_STORAGE_DELETE_ENABLED
54+
value: "true"
55+
- name: REGISTRY_LOG_LEVEL
56+
value: info
57+
- name: REGISTRY_STORAGE
58+
value: "{{ .Values.global.storage }}"
59+
ports:
60+
- containerPort: 5000
61+
volumeMounts:
62+
- name: registry-storage
63+
mountPath: /var/lib/registry
64+
- name: registry-creds
65+
mountPath: /var/run/secrets/deis/registry/creds
66+
volumes:
67+
- name: registry-storage
68+
emptyDir: {}
69+
- name: registry-creds
70+
secret:
71+
secretName: registry-storage-keyfile
72+
{{- end }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{- if eq .Values.global.registry_location "on-cluster" }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: deis-registry
6+
labels:
7+
heritage: deis
8+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if eq .Values.global.registry_location "on-cluster" }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: deis-registry
6+
labels:
7+
heritage: deis
8+
spec:
9+
ports:
10+
- name: http
11+
port: 80
12+
targetPort: 5000
13+
selector:
14+
app: deis-registry
15+
{{- end }}
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: registry-storage-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+
registry-bucket: {{.Values.gcs.registry_bucket | b64enc}}{{ else if eq .Values.global.storage "azure"}}
13+
accountname: {{.Values.azure.accountname | b64enc }}
14+
accountkey: {{ .Values.azure.accountkey | b64enc }}
15+
registry-container: {{ .Values.azure.registry_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+
registry-bucket: {{ .Values.s3.registry_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+
registry-container: {{ .swift.registry_container | b64enc }}{{else if eq .Values.global.storage "minio"}}
26+
accesskey: OFRaUlkySlJXTVBUNlVNWFI2STU=
27+
secretkey: Z2JzdHJPdm90TU1jZzJzTWZHVWhBNWE2RXQvRUk1QUx0SUhzb2JZaw=={{ end }}

charts/registry/values.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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: ""
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+
26+
27+
s3:
28+
# Your AWS access key. Leave it empty if you want to use IAM credentials.
29+
accesskey: ""
30+
# Your AWS secret key. Leave it empty if you want to use IAM credentials.
31+
secretkey: ""
32+
# Any S3 region
33+
region: "us-west-1"
34+
# Your buckets.
35+
registry_bucket: "your-registry-bucket-name"
36+
37+
azure:
38+
accountname: "YOUR ACCOUNT NAME"
39+
accountkey: "YOUR ACCOUNT KEY"
40+
registry_container: "your-registry-container-name"
41+
42+
gcs:
43+
# key_json is expanded into a JSON file on the remote server. It must be
44+
# well-formatted JSON data.
45+
key_json: ''
46+
registry_bucket: "your-registry-bucket-name"
47+
48+
swift:
49+
username: "Your OpenStack Swift Username"
50+
password: "Your OpenStack Swift Password"
51+
authurl: "Swift auth URL for obtaining an auth token"
52+
# Your OpenStack tenant name if you are using auth version 2 or 3.
53+
tenant: ""
54+
authversion: "Your OpenStack swift auth version"
55+
registry_container: "your-registry-container-name"

0 commit comments

Comments
 (0)