-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #00 fix: helm chart nodebb deployment (#1849)
nodebb variables
- Loading branch information
1 parent
57f577b
commit d2ef514
Showing
9 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sunbird_nodebb_url=https://{{ domain_name }}/discussions | ||
redis_nodebb_host="{{ groups['redis-nodebb'][0]}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for Kubernetes | ||
name: nodebb | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "print.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "print.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "print.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "print.labels" -}} | ||
app.kubernetes.io/name: {{ include "print.name" . }} | ||
helm.sh/chart: {{ include "print.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This file will get replaced at runtime |
81 changes: 81 additions & 0 deletions
81
kubernetes/helm_charts/core/nodebb/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Chart.Name }} | ||
namespace: {{ .Values.namespace }} | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: {{ .Values.strategy.maxsurge }} | ||
maxUnavailable: {{ .Values.strategy.maxunavailable }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Chart.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Chart.Name }} | ||
spec: | ||
volumes: | ||
- name: nodebb-config-json | ||
configMap: | ||
name: nodebb-config-json | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: nodebb-config-json | ||
mountPath: /usr/src/app/config.json | ||
subPath: config.json | ||
resources: | ||
{{ toYaml .Values.resources | indent 10 }} | ||
ports: | ||
- containerPort: {{ .Values.network.port }} | ||
{{- if .Values.healthcheck }} | ||
livenessProbe: | ||
{{ toYaml .Values.livenessProbe | indent 10 }} | ||
readinessProbe: | ||
{{ toYaml .Values.readinessProbe | indent 10 }} | ||
{{- end }} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nodebb-config-json | ||
data: | ||
config.json: |- | ||
{ | ||
"url": "{{ .Values.nodebb_url }}", | ||
"secret": "100101", | ||
"database": "redis", | ||
"port": "4567", | ||
"redis": { | ||
"host": "{{ .Values.redis_nodebb_host }}", | ||
"port": 6379, | ||
"username": "", | ||
"password": "", | ||
"database": "0" | ||
} | ||
} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Chart.Name }}-service | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
app: {{ .Chart.Name }} | ||
spec: | ||
ports: | ||
- name: http-{{ .Chart.Name }} | ||
protocol: TCP | ||
port: {{ .Values.network.port }} | ||
selector: | ||
app: {{ .Chart.Name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#jinja2:lstrip_blocks: True | ||
|
||
### Default variable file for nodebb-service ### | ||
|
||
namespace: {{ namespace }} | ||
imagepullsecrets: {{ imagepullsecrets }} | ||
dockerhub: nodebb | ||
|
||
replicaCount: {{nodebb_replicacount|default(1)}} | ||
repository: 'docker' | ||
image_tag: v1.13.4-5 | ||
resources: | ||
requests: | ||
cpu: {{nodebb_cpu_req|default('50m')}} | ||
memory: {{nodebb_mem_req|default('50Mi')}} | ||
limits: | ||
cpu: {{nodebb_cpu_limit|default('1')}} | ||
memory: {{nodebb_mem_limit|default('1024Mi')}} | ||
network: | ||
port: 4567 | ||
strategy: | ||
type: RollingUpdate | ||
maxsurge: {{ nodebb_maxsurge|default('25%') }} | ||
maxunavailable: {{ nodebb_maxunavailable|default('25%') }} | ||
|
||
nodebb_url: {{ sunbird_nodebb_url }} | ||
redis_nodebb_host: {{ redis_nodebb_host }} |