Skip to content

Commit 50c620a

Browse files
committed
chore(builder): minio/minio#14331
1 parent 9a4cf32 commit 50c620a

5 files changed

Lines changed: 9 additions & 60 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The builder is primarily a git server that responds to `git push`es by executing
2121
1. Calls `git archive` to produce a tarball (i.e. a `.tar.gz` file) on the local file system
2222
2. Saves the tarball to centralized object storage according to the following rules:
2323
- If the `BUILDER_STORAGE` environment variable is other than `minio`, attempts to create the appropriate storage driver and saves using this driver.
24-
- Otherwise, if `BUILDER_STORAGE` is `minio` and the `DRYCC_MINIO_SERVICE_HOST` and `DRYCC_MINIO_SERVICE_PORT` environment variables exist (these are standard [Kubernetes service discovery environment variables](http://kubernetes.io/docs/user-guide/services/#environment-variables)), saves to the [S3 API][s3-api-ref] compatible server at `http://$DRYCC_MINIO_SERVICE_HOST:$DRYCC_MINIO_SERVICE_HOST`
24+
- Otherwise, if `BUILDER_STORAGE` is `minio` and the `DRYCC_MINIO_ENDPOINT` environment variables exist (these are standard [Kubernetes service discovery environment variables](http://kubernetes.io/docs/user-guide/services/#environment-variables)), saves to the [S3 API][s3-api-ref] compatible server at `http://$DRYCC_MINIO_ENDPOINT`
2525
3. Starts a new [Kubernetes Pod](http://kubernetes.io/docs/user-guide/pods/) to build the code, according to the following rules:
2626
- If there is a `Dockerfile`, build the container with imagebuilder
2727
- Otherwise, use imagebuilder to build CNCF native buildpack

charts/builder/templates/builder-deployment.yaml

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ spec:
3131
- netcat
3232
- -v
3333
- -a
34-
- $(DRYCC_MINIO_SERVICE_HOST):$(DRYCC_MINIO_SERVICE_PORT)
34+
- $(DRYCC_MINIO_ENDPOINT)
35+
{{- include "builder.envs" . | indent 8 }}
3536
containers:
3637
- name: drycc-builder
3738
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/builder:{{.Values.imageTag}}
@@ -41,58 +42,8 @@ spec:
4142
name: ssh
4243
- containerPort: 8092
4344
name: healthsrv
44-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
45-
resources:
46-
limits:
47-
{{- if (.Values.limitsCpu) }}
48-
cpu: {{.Values.limitsCpu}}
49-
{{- end}}
50-
{{- if (.Values.limitsMemory) }}
51-
memory: {{.Values.limitsMemory}}
52-
{{- end}}
53-
{{- end}}
54-
env:
55-
# NOTE(bacongobbler): use drycc/registry_proxy to work around Docker --insecure-registry requirements
56-
- name: "DRYCC_REGISTRY_PROXY_HOST"
57-
value: "127.0.0.1"
58-
- name: "DRYCC_REGISTRY_PROXY_PORT"
59-
value: "{{ .Values.global.registryProxyPort }}"
60-
- name: "HEALTH_SERVER_PORT"
61-
value: "8092"
62-
- name: "EXTERNAL_PORT"
63-
value: "2223"
64-
- name: BUILDER_STORAGE
65-
value: "{{ .Values.global.storage }}"
66-
- name: "DRYCC_REGISTRY_LOCATION"
67-
value: "{{ .Values.global.registryLocation }}"
68-
- name: "TTL_SECONDS_AFTER_FINISHED"
69-
value: "{{ .Values.global.ttlSecondsAfterFinished }}"
70-
# Set GIT_LOCK_TIMEOUT to number of minutes you want to wait to git push again to the same repository
71-
- name: "GIT_LOCK_TIMEOUT"
72-
value: "30"
73-
- name: IMAGEBUILDER_IMAGE_PULL_POLICY
74-
valueFrom:
75-
configMapKeyRef:
76-
name: imagebuilder-config
77-
key: imagePullPolicy
78-
# This var needs to be passed so that the minio client (https://github.com/minio/mc) will work in Alpine linux
79-
- name: "DOCKERIMAGE"
80-
value: "1"
81-
- name: "DRYCC_DEBUG"
82-
value: "false"
83-
- name: "POD_NAMESPACE"
84-
valueFrom:
85-
fieldRef:
86-
fieldPath: metadata.namespace
87-
- name: DRYCC_BUILDER_KEY
88-
valueFrom:
89-
secretKeyRef:
90-
name: builder-key-auth
91-
key: builder-key
92-
{{- if (.Values.builder_pod_node_selector) }}
93-
- name: BUILDER_POD_NODE_SELECTOR
94-
value: {{.Values.builder_pod_node_selector}}
95-
{{- end}}
45+
{{- include "builder.limits" . | indent 8 }}
46+
{{- include "builder.envs" . | indent 8 }}
9647
livenessProbe:
9748
httpGet:
9849
path: /healthz

pkg/conf/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import (
1010

1111
const (
1212
storageCredLocation = "/var/run/secrets/drycc/objectstore/creds/"
13-
minioHostEnvVar = "DRYCC_MINIO_SERVICE_HOST"
14-
minioPortEnvVar = "DRYCC_MINIO_SERVICE_PORT"
13+
minioHostEnvVar = "DRYCC_MINIO_ENDPOINT"
1514
gcsKey = "key.json"
1615
)
1716

pkg/conf/config_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ func TestGetStorageParams(t *testing.T) {
6868

6969
env := sys.NewFakeEnv()
7070
env.Envs = map[string]string{
71-
"BUILDER_STORAGE": "minio",
72-
"DRYCC_MINIO_SERVICE_HOST": "localhost",
73-
"DRYCC_MINIO_SERVICE_PORT": "8088",
71+
"BUILDER_STORAGE": "minio",
72+
"DRYCC_MINIO_ENDPOINT": "localhost:8088",
7473
}
7574
params, err = GetStorageParams(env)
7675
if err != nil {

rootfs/bin/normalize_storage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ if [ -f $SECRET_KEY_FILE ]; then
1616
export MINIO_SECRET_KEY
1717
fi
1818

19-
export MINIO_ENDPOINT=http://"${DRYCC_MINIO_SERVICE_HOST}:${DRYCC_MINIO_SERVICE_PORT}"
19+
export MINIO_ENDPOINT=http://"${DRYCC_MINIO_ENDPOINT}"
2020

2121
mc config host add minio "${MINIO_ENDPOINT}" "${MINIO_ACCESS_KEY}" "${MINIO_SECRET_KEY}"

0 commit comments

Comments
 (0)