Skip to content

Commit

Permalink
[stable/centrifugo] Update centrifugo to 2.1.0 (helm#10373)
Browse files Browse the repository at this point in the history
* update centrifugo to 2.1.0 and update the healt check

Signed-off-by: cpanato <[email protected]>

* add myself as owner of this chart

Signed-off-by: cpanato <[email protected]>

* add simple test

Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato authored and k8s-ci-robot committed Jan 4, 2019
1 parent b38f668 commit 325a10a
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 32 deletions.
3 changes: 3 additions & 0 deletions stable/centrifugo/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
.project
.idea/
*.tmproj

# OWNERS file for Kubernetes
OWNERS
4 changes: 2 additions & 2 deletions stable/centrifugo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
version: 3.0.0
appVersion: 2.0.2
version: 3.1.0
appVersion: 2.1.0
description: Centrifugo is a real-time messaging server.
name: centrifugo
keywords:
Expand Down
4 changes: 4 additions & 0 deletions stable/centrifugo/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
approvers:
- cpanato
reviewers:
- cpanato
9 changes: 5 additions & 4 deletions stable/centrifugo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ The following table lists the configurable parameters of the Centrifugo chart an

| Parameter | Description | Default |
| -------------------------- | ------------------------------------- | --------------------------------------------------------- |
| `image` | Cetrifugo image | `centrifugo/centrifugo:{VERSION}` |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `image.repository` | Cetrifugo image repository | `centrifugo/centrifugo` |
| `image.tag` | Cetrifugo image tag | `v2.1.0` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `config` | Centrifugo config | `default` |
| `args` | Centrifugo args | `--web=true` |
| `args` | Centrifugo args | `--config=centrifugo/config.json --admin --health` |

For more information please refer to the [documentation](https://fzambia.gitbooks.io/centrifugal/content/index.html).

Expand Down
8 changes: 8 additions & 0 deletions stable/centrifugo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "centrifugo.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

6 changes: 3 additions & 3 deletions stable/centrifugo/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "centrifugo.fullname" . }}-config
name: {{ include "centrifugo.fullname" . }}-config
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app: {{ template "centrifugo.name" . }}
chart: {{ include "centrifugo.chart" . }}
app: {{ include "centrifugo.name" . }}
data:
config.json: |-
{{ toJson .Values.config| indent 4 }}
26 changes: 14 additions & 12 deletions stable/centrifugo/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app: {{ template "centrifugo.name" . }}
chart: {{ include "centrifugo.chart" . }}
app: {{ include "centrifugo.name" . }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
Expand All @@ -18,7 +18,7 @@ spec:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
labels:
app: {{ template "centrifugo.name" . }}
app: {{ include "centrifugo.name" . }}
release: {{ .Release.Name }}
spec:
containers:
Expand All @@ -35,38 +35,40 @@ spec:
- name: CENTRIFUGO_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
key: admin-password
- name: CENTRIFUGO_ADMIN_SECRET
valueFrom:
secretKeyRef:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
key: admin-secret
- name: CENTRIFUGO_SECRET
valueFrom:
secretKeyRef:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
key: secret
volumeMounts:
- name: "{{ template "centrifugo.fullname" . }}-config"
- name: "{{ include "centrifugo.fullname" . }}-config"
mountPath: "/centrifugo"
readOnly: true
ports:
- name: http
containerPort: {{ .Values.service.port }}
livenessProbe:
tcpSocket:
httpGet:
path: /health
port: {{ .Values.service.port }}
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
tcpSocket:
httpGet:
path: /health
port: {{ .Values.service.port }}
initialDelaySeconds: 15
periodSeconds: 10
resources:
{{ toYaml .Values.resources | indent 10 }}
volumes:
- name: {{ template "centrifugo.fullname" . }}-config
- name: {{ include "centrifugo.fullname" . }}-config
configMap:
name: {{ template "centrifugo.fullname" . }}-config
name: {{ include "centrifugo.fullname" . }}-config
6 changes: 3 additions & 3 deletions stable/centrifugo/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app: {{ template "centrifugo.name" . }}
chart: {{ include "centrifugo.chart" . }}
app: {{ include "centrifugo.name" . }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
Expand Down
6 changes: 3 additions & 3 deletions stable/centrifugo/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "centrifugo.fullname" . }}
name: {{ include "centrifugo.fullname" . }}
labels:
app: {{ template "centrifugo.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app: {{ include "centrifugo.name" . }}
chart: {{ include "centrifugo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
Expand Down
8 changes: 4 additions & 4 deletions stable/centrifugo/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ metadata:
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app: {{ template "centrifugo.name" . }}
name: {{ template "centrifugo.fullname" . }}
chart: {{ include "centrifugo.chart" . }}
app: {{ include "centrifugo.name" . }}
name: {{ include "centrifugo.fullname" . }}
spec:
type: "{{ .Values.service.type }}"
clusterIP: "{{ .Values.service.clusterIP }}"
Expand All @@ -34,5 +34,5 @@ spec:
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app: {{ template "centrifugo.name" . }}
app: {{ include "centrifugo.name" . }}
release: {{ .Release.Name }}
14 changes: 14 additions & 0 deletions stable/centrifugo/templates/tests/centrifugo-config-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "centrifugo.fullname" . }}-tests
labels:
app.kubernetes.io/name: {{ include "centrifugo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "centrifugo.chart" . }}
data:
run.sh: |-
@test "Testing if centrifugo ui is accessible" {
curl --retry 48 --retry-delay 10 {{ include "centrifugo.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
}
42 changes: 42 additions & 0 deletions stable/centrifugo/templates/tests/centrifugo-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: Pod
metadata:
name: {{ include "centrifugo.fullname" . }}-test-{{ randAlphaNum 5 | lower }}
labels:
app.kubernetes.io/name: {{ include "centrifugo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "centrifugo.chart" . }}
annotations:
"helm.sh/hook": test-success
spec:
initContainers:
- name: "test-framework"
image: "dduportal/bats:0.4.0"
command:
- "bash"
- "-c"
- |
set -ex
# copy bats to tools dir
cp -R /usr/local/libexec/ /tools/bats/
volumeMounts:
- mountPath: /tools
name: tools
containers:
- name: {{ .Release.Name }}-test
image: "dduportal/bats:0.4.0"
command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
volumeMounts:
- mountPath: /tests
name: tests
readOnly: true
- mountPath: /tools
name: tools
volumes:
- name: tests
configMap:
name: {{ include "centrifugo.fullname" . }}-tests
- name: tools
emptyDir: {}
restartPolicy: Never
3 changes: 2 additions & 1 deletion stable/centrifugo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ replicaCount: 1

image:
repository: centrifugo/centrifugo
tag: v2.0.2
tag: v2.1.0
pullPolicy: IfNotPresent

service:
Expand Down Expand Up @@ -60,5 +60,6 @@ admin:
args:
- --config=centrifugo/config.json
- --admin
- --health

resources: {}

0 comments on commit 325a10a

Please sign in to comment.