Skip to content

Commit

Permalink
join distribution/distributor/redis to a single pod + remove distribu…
Browse files Browse the repository at this point in the history
…tor-token
  • Loading branch information
omerk committed Feb 4, 2019
1 parent 4f8c3e4 commit 7a7f160
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 386 deletions.
9 changes: 9 additions & 0 deletions stable/distribution/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# JFrog Distribution Chart Changelog
All changes to this project chart be documented in this file.

## [3.0.0] - Feb 04, 2019
* Join distribution, distributor and redis to a single pod
* Distributor internal communication token generated and consumed automatically
* **UPGRADE NOTES:** For upgrading an existing deployment (pre 1.5.1), follow the following:
* Distribution should be idle. This means not have any distributions in queue or in process
* If in HA (replicaCount > 1)
* Scale down **existing deployment** to 1 with `helm upgrade .... --set replicaCount=1 ....`.
* Once upgraded and new version is running, scale back up to the original size.

## [2.1.2] - Jan 24, 2019
* Added support for `distribution.customInitContainers` to create custom init containers for Distribution pod

Expand Down
4 changes: 2 additions & 2 deletions stable/distribution/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
name: distribution
description: A Helm chart for JFrog Distribution
version: 2.1.2
appVersion: 1.5.0
version: 3.0.0
appVersion: 1.5.1
home: https://jfrog.com/platform/
icon: https://raw.githubusercontent.com/jfrog/artifactory-dcos/master/images/jfrog_med.png
keywords:
Expand Down
1 change: 0 additions & 1 deletion stable/distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ The following table lists the configurable parameters of the distribution chart
| `distributor.image.pullPolicy` | Container pull policy | `IfNotPresent` |
| `distributor.image.repository` | Container image | `docker.jfrog.io/jf-distribution` |
| `distributor.image.version` | Container image tag | `.Chart.AppVersion` |
| `distributor.token` | Distributor token | ` ` |
| `distributor.persistence.mountPath` | Distributor persistence volume mount path | `"/bt-distributor"` |
| `distributor.persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
| `distributor.persistence.storageClass` | Storage class of backing PVC | `nil (uses alpha storage class annotation)` |
Expand Down
1 change: 0 additions & 1 deletion stable/distribution/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ redis:
enabled: false

distributor:
token: "eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQiOiJ6WWFWQjVFRlpkOXlpbWtCNkZTbDAtSWFhMHRPWldLX293c1BTVTNTZmdNIn0.eyJzdWIiOiJJTlRFUk5BTCIsInNjcCI6ImFwcGxpZWQtcGVybWlzc2lvbnNcL3N5c3RlbSIsImF1ZCI6ImpmZHNAMDFjN3pxd2FnOWNmNTAwd2FnOXZhcTF3cjkiLCJpc3MiOiJqZmRzQDAxYzd6cXdhZzljZjUwMHdhZzl2YXExd3I5IiwiZXhwIjoyNDY3NjI1MDczLCJpYXQiOjE1MjE1NDUwNzMsImp0aSI6IjE0ZjJjN2IxLTMzYzQtNDA0Yy04YTllLTJmZjU2OGFjODRlOSJ9.ACfT3pfu4wTTt1wOkyqwYCp9UUVWNwMLl3ZyuO-igDR9N_G-G3oMkuCFekAzgOrTcbGjrXTDMNwoRyYhHUs4wtYxM9yAA-u72EhVz10stL9B0d2JUOamc8xJaLvQDhL38TYiTjdgNVsy726qgxzX2xnx1M8VSp9Qnw7r2ZGBQ6LjrESIUZb8IXy-93oxYqDSkWvjOJZiNQXhJBgOzhzq3r-buaGgxOMoC7DduCctCT0FIxd1jrsZPUnpH3YGE374j7YGcGBdy7eQj-skM3YircJVgk6XFYJBKZBJ8pX3NLZznirG2m9QbhLCRhH1T6B4g-HZvy251wz3QBUdmzO6Cg"
persistence:
enabled: false

Expand Down
6 changes: 3 additions & 3 deletions stable/distribution/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
Expand the name of the chart.
*/}}
{{- define "distribution.name" -}}
{{- default .Chart.Name .Values.distribution.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name .Values.distribution.name .Values.distributionNameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
The distributor name
*/}}
{{- define "distributor.name" -}}
{{- default .Chart.Name .Values.distributor.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name .Values.distributor.name .Values.distributorNameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down Expand Up @@ -86,7 +86,7 @@ Create chart name and version as used by the chart label.
Expand the name of the chart.
*/}}
{{- define "redis.name" -}}
{{- printf "%s-%s" .Chart.Name "redis" | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name .Values.redis.name .Values.redisNameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down
26 changes: 0 additions & 26 deletions stable/distribution/templates/distribution-startup-script.yaml

This file was deleted.

86 changes: 75 additions & 11 deletions stable/distribution/templates/distribution-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ spec:
- name: {{ .Values.distribution.name }}
image: '{{ .Values.distribution.image.repository }}:{{ default .Chart.AppVersion .Values.distribution.image.version }}'
imagePullPolicy: {{ .Values.distribution.image.imagePullPolicy }}
command:
- '/bin/sh'
- '-c'
- 'sh /scripts/startup.sh'
securityContext:
allowPrivilegeEscalation: false
ports:
Expand All @@ -77,7 +73,7 @@ spec:
-Xmx{{ .Values.distribution.javaOpts.xmx }}
{{- end}}
{{- if .Values.distribution.serviceId }}
-Djfrog.distribution.platform.serviceId={{ .Values.distribution.serviceId }}
-Djfrog.distribution.platform.distributionServiceId={{ .Values.distribution.serviceId }}
{{- end}}
-Dspring.profiles.active=production'
{{- if .Values.distribution.masterKey }}
Expand Down Expand Up @@ -127,12 +123,14 @@ spec:
key: db-password
{{- end }}
{{- end }}
- name: REDIS_HOST
value: 'localhost'
- name: REDIS_PORT
value: '{{ .Values.redis.port }}'
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "distribution.fullname" . }}-redis-connection
name: {{ template "distribution.fullname" . }}-redis-secret
key: password
- name: BT_ARTIFACTORY_URL
value: {{ .Values.distribution.env.artifactoryUrl | quote }}
Expand All @@ -155,8 +153,6 @@ spec:
value: {{ .Values.distribution.env.artifactoryCi1Url }}
{{- end }}
volumeMounts:
- name: startup
mountPath: "/scripts"
- name: distribution-data
mountPath: {{ .Values.distribution.persistence.mountPath | quote }}
resources:
Expand All @@ -174,6 +170,77 @@ spec:
port: {{ .Values.distribution.internalPort }}
initialDelaySeconds: 60
periodSeconds: 10
- name: {{ .Values.distributor.name }}
image: '{{ .Values.distributor.image.repository }}:{{ default .Chart.AppVersion .Values.distributor.image.version }}'
imagePullPolicy: {{ .Values.distributor.image.imagePullPolicy }}
securityContext:
allowPrivilegeEscalation: false
command:
- '/bin/sh'
- '-c'
- 'sh /scripts/startup.sh'
env:
- name: DEFAULT_JAVA_OPTS
value: '-Ddistribution.home={{ .Values.distributor.persistence.mountPath }}
-Djfrog.distributor.distribution.internal-api-url=http://localhost:{{ .Values.distribution.internalPort }}/api/internal
-Dfile.encoding=UTF8 -Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false -Duser.timezone=UTC
{{- if .Values.distributor.javaOpts.xms }}
-Xms{{ .Values.distributor.javaOpts.xms }}
{{- end}}
{{- if .Values.distributor.javaOpts.xmx }}
-Xmx{{ .Values.distributor.javaOpts.xmx }}
{{- end}}
-Dspring.profiles.active=production'
- name: REDIS_HOST
value: 'localhost'
- name: REDIS_PORT
value: '{{ .Values.redis.port }}'
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "distribution.fullname" . }}-redis-secret
key: password
volumeMounts:
- name: distributor-data
mountPath: {{ .Values.distributor.persistence.mountPath | quote }}
resources:
{{ toYaml .Values.distributor.resources | indent 10 }}
- name: {{ template "redis.name" . }}
image: '{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}'
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
env:
- name: REDIS_REPLICATION_MODE
value: master
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "distribution.fullname" . }}-redis-secret
key: password
- name: REDIS_PORT
value: {{ .Values.redis.port | quote }}
- name: REDIS_DISABLE_COMMANDS
value: {{ .Values.redis.disableCommands }}
ports:
- name: redis
containerPort: {{ .Values.redis.port }}
readinessProbe:
initialDelaySeconds: 10
exec:
command:
- redis-cli
- ping
livenessProbe:
initialDelaySeconds: 30
exec:
command:
- redis-cli
- ping
resources:
{{ toYaml .Values.redis.resources | indent 10 }}
volumeMounts:
- name: redis-data
mountPath: {{ .Values.redis.persistence.path }}
{{- with .Values.distribution.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand All @@ -187,9 +254,6 @@ spec:
{{ toYaml . | indent 8 }}
{{- end }}
volumes:
- name: startup
configMap:
name: {{ template "distribution.fullname" . }}-startup
{{- if not .Values.distribution.persistence.enabled }}
- name: distribution-data
emptyDir: {}
Expand Down
18 changes: 0 additions & 18 deletions stable/distribution/templates/distribution-svc-headless.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions stable/distribution/templates/distributor-startup-script.yaml

This file was deleted.

Loading

0 comments on commit 7a7f160

Please sign in to comment.