Skip to content

Commit

Permalink
Merge pull request #4478 from derekperkins/helm-stuff
Browse files Browse the repository at this point in the history
helm: safer shutdown + flag defaults
  • Loading branch information
sougou authored Dec 21, 2018
2 parents 345d3bd + 0c601e4 commit 524f4c2
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 19 deletions.
51 changes: 51 additions & 0 deletions helm/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

version_tag=1.0.3

docker pull vitess/k8s:latest
docker tag vitess/k8s:latest vitess/k8s:helm-$version_tag
docker push vitess/k8s:helm-$version_tag

docker pull vitess/vtgate:latest
docker tag vitess/vtgate:latest vitess/vtgate:helm-$version_tag
docker push vitess/vtgate:helm-$version_tag

docker pull vitess/vttablet:latest
docker tag vitess/vttablet:latest vitess/vttablet:helm-$version_tag
docker push vitess/vttablet:helm-$version_tag

docker pull vitess/mysqlctld:latest
docker tag vitess/mysqlctld:latest vitess/mysqlctld:helm-$version_tag
docker push vitess/mysqlctld:helm-$version_tag

docker pull vitess/vtctl:latest
docker tag vitess/vtctl:latest vitess/vtctl:helm-$version_tag
docker push vitess/vtctl:helm-$version_tag

docker pull vitess/vtctlclient:latest
docker tag vitess/vtctlclient:latest vitess/vtctlclient:helm-$version_tag
docker push vitess/vtctlclient:helm-$version_tag

docker pull vitess/vtctld:latest
docker tag vitess/vtctld:latest vitess/vtctld:helm-$version_tag
docker push vitess/vtctld:helm-$version_tag

docker pull vitess/vtworker:latest
docker tag vitess/vtworker:latest vitess/vtworker:helm-$version_tag
docker push vitess/vtworker:helm-$version_tag

docker pull vitess/logrotate:latest
docker tag vitess/logrotate:latest vitess/logrotate:helm-$version_tag
docker push vitess/logrotate:helm-$version_tag

docker pull vitess/logtail:latest
docker tag vitess/logtail:latest vitess/logtail:helm-$version_tag
docker push vitess/logtail:helm-$version_tag

docker pull vitess/pmm-client:latest
docker tag vitess/pmm-client:latest vitess/pmm-client:helm-$version_tag
docker push vitess/pmm-client:helm-$version_tag

docker pull vitess/orchestrator:latest
docker tag vitess/orchestrator:latest vitess/orchestrator:helm-$version_tag
docker push vitess/orchestrator:helm-$version_tag
15 changes: 14 additions & 1 deletion helm/vitess/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.0.3 - 2018-12-20

### Changes
* Start tagging helm images and use them as default
* Added commonly used flags to values.yaml for vtgate & vttablet for discoverability.
Some match the binary flag defaults, and some have been set to more production ready values.
* Extended vttablet terminationGracePeriodSeconds from 600 to 60000000.
This will block on `PlannedReparent` in the `preStopHook` forever to prevent
unsafe `EmergencyReparent` operations when the pod is killed.

### Bug fixes
* Use `$MYSQL_FLAVOR` to set flavor instead of `$EXTRA_MY_CNF`

## 1.0.2 - 2018-12-11

### Bug fixes
Expand All @@ -15,4 +28,4 @@
### Bug fixes
* PMM wouldn't bootstrap correctly on a new cluster

## 1.0.0, 2018-12-03 Vitess Helm Chart goes GA!
## 1.0.0 - 2018-12-03 Vitess Helm Chart goes GA!
2 changes: 1 addition & 1 deletion helm/vitess/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: vitess
version: 1.0.2
version: 1.0.3
description: Single-Chart Vitess Cluster
keywords:
- vitess
Expand Down
4 changes: 2 additions & 2 deletions helm/vitess/templates/_orchestrator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
value: "15999"

- name: recovery-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent
env:
- name: TAIL_FILEPATH
Expand All @@ -133,7 +133,7 @@ spec:
mountPath: /tmp

- name: audit-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent
env:
- name: TAIL_FILEPATH
Expand Down
2 changes: 1 addition & 1 deletion helm/vitess/templates/_pmm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ spec:
trap : TERM INT; sleep infinity & wait

- name: pmm-client-metrics-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent
env:
- name: TAIL_FILEPATH
Expand Down
12 changes: 6 additions & 6 deletions helm/vitess/templates/_vttablet.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
shard: {{ $shardClean | quote }}
type: {{ $tablet.type | quote }}
spec:
terminationGracePeriodSeconds: 600
terminationGracePeriodSeconds: 60000000
{{ include "pod-security" . | indent 6 }}
{{ include "vttablet-affinity" (tuple $cellClean $keyspaceClean $shardClean $cell.region) | indent 6 }}

Expand Down Expand Up @@ -344,7 +344,7 @@ spec:
# - use GTID_SUBTRACT

RETRY_COUNT=0
MAX_RETRY_COUNT=5
MAX_RETRY_COUNT=100000

# retry reparenting
until [ $DONE_REPARENTING ]; do
Expand Down Expand Up @@ -513,7 +513,7 @@ spec:
{{ define "cont-logrotate" }}

- name: logrotate
image: vitess/logrotate:latest
image: vitess/logrotate:helm-1.0.3
imagePullPolicy: IfNotPresent
volumeMounts:
- name: vtdataroot
Expand All @@ -527,7 +527,7 @@ spec:
{{ define "cont-mysql-errorlog" }}

- name: error-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent

env:
Expand All @@ -545,7 +545,7 @@ spec:
{{ define "cont-mysql-slowlog" }}

- name: slow-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent

env:
Expand All @@ -563,7 +563,7 @@ spec:
{{ define "cont-mysql-generallog" }}

- name: general-log
image: vitess/logtail:latest
image: vitess/logtail:helm-1.0.3
imagePullPolicy: IfNotPresent

env:
Expand Down
55 changes: 47 additions & 8 deletions helm/vitess/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ etcd:
# Default values for vtctld resources defined in 'topology'
vtctld:
serviceType: ClusterIP
vitessTag: latest
vitessTag: helm-1.0.3
resources:
# requests:
# cpu: 100m
Expand All @@ -188,23 +188,32 @@ vtctld:
# Default values for vtgate resources defined in 'topology'
vtgate:
serviceType: ClusterIP
vitessTag: latest
vitessTag: helm-1.0.3
resources:
# requests:
# cpu: 500m
# memory: 512Mi
extraFlags: {}

# Additional flags that will be appended to the vtgate command.
# The options below are the most commonly adjusted, but any flag can be put here.
# run vtgate --help to see all available flags
extraFlags:
# MySQL server version to advertise. (default "5.5.10-Vitess")
# If running 8.0, you may need to use something like "8.0.13-Vitess"
# to prevent db clients from running deprecated queries on startup
mysql_server_version: "5.5.10-Vitess"

secrets: [] # secrets are mounted under /vt/usersecrets/{secretname}

# Default values for vtctlclient resources defined in 'topology'
vtctlclient:
vitessTag: latest
vitessTag: helm-1.0.3
extraFlags: {}
secrets: [] # secrets are mounted under /vt/usersecrets/{secretname}

# Default values for vtworker resources defined in 'jobs'
vtworker:
vitessTag: latest
vitessTag: helm-1.0.3
extraFlags: {}
resources:
# requests:
Expand All @@ -215,7 +224,7 @@ vtworker:

# Default values for vttablet resources defined in 'topology'
vttablet:
vitessTag: latest
vitessTag: helm-1.0.3

# valid values are
# - mysql56 (for MySQL 8.0)
Expand Down Expand Up @@ -248,8 +257,38 @@ vttablet:
# If the value is "test", then mysql is instanitated with a smaller footprint.
mysqlSize: prod

# Additional flags that will be appended to the vttablet command
extraFlags: {}
# Additional flags that will be appended to the vttablet command.
# The options below are the most commonly adjusted, but any flag can be put here.
# run vttablet --help to see all available flags
extraFlags:
# query server max result size, maximum number of rows allowed to return
# from vttablet for non-streaming queries.
queryserver-config-max-result-size: 10000

# query server query timeout (in seconds), this is the query timeout in vttablet side.
# If a query takes more than this timeout, it will be killed.
queryserver-config-query-timeout: 30

# query server connection pool size, connection pool is used by
# regular queries (non streaming, not in a transaction)
queryserver-config-pool-size: 24

# query server stream connection pool size, stream pool is used by stream queries:
# queries that return results to client in a streaming fashion
queryserver-config-stream-pool-size: 100

# query server transaction cap is the maximum number of transactions allowed to
# happen at any given point of a time for a single vttablet.
# e.g. by setting transaction cap to 100, there are at most 100 transactions
# will be processed by a vttablet and the 101th transaction will be blocked
# (and fail if it cannot get connection within specified timeout)
queryserver-config-transaction-cap: 300

# Size of the connection pool for app connections
app_pool_size: 40

# Size of the connection pool for dba connections
dba_pool_size: 20

# User secrets that will be mounted under /vt/usersecrets/{secretname}/
secrets: []
Expand Down

0 comments on commit 524f4c2

Please sign in to comment.