Skip to content

Helm chart to deploy Tock #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tock-mongo-data/
./kind
.idea
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
HELM_NS_OPTS ?= $(shell $(HELM_INSTALL) && echo --create-namespace)
HELM_OPTIONS ?=
HELM_INSTALL ?= false
HELM_UPGRADE ?= $(shell $(HELM_INSTALL) || echo diff) upgrade --install $(shell $(HELM_INSTALL) || echo -C 5)

TOCK_NAMESPACE ?= tock

MONGODB_OPERATOR_VERSION ?= master

mongodb-kubernetes-operator:
git clone https://github.com/mongodb/mongodb-kubernetes-operator.git

deploy-mongodb-operator: mongodb-kubernetes-operator
kubectl apply -k mongodb-kubernetes-operator/config/rbac --namespace operators
kubectl apply -f mongodb-kubernetes-operator/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml
kubectl apply -f mongodb-operator/

deploy-tock:
# Deploy tock
helm $(HELM_UPGRADE) tock charts/tock $(HELM_NS_OPTS) --namespace $(TOCK_NAMESPACE) $(HELM_OPTIONS)

clean:
rm -rf mongodb-kubernetes-operator
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,31 @@ kubectl logs -f -l type=bot-api
```
./kind delete cluster
```

## Deploy Tock with Helm chart

Clone this repo then go inside it then run the following command:

helm install my-tock-release charts/tock --namespace my-namespace --create-namespace

To install tock inside tock namespace, you can try this command:

helm install tock charts/tock --namespace tock

To remove things, remove the Helm chart:

helm uninstall -n tock tock

To publish the application with an ingress, use the following values:

```yaml
---

ingress:
enabled: true
hosts:
- host: tock.domain.name
tls:
- hosts:
- tock.domain.name
```
23 changes: 23 additions & 0 deletions charts/tock/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/tock/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: tock
description: A Helm chart to deploy tock bot
type: application
version: 0.1.0
appVersion: "0.1.0"
23 changes: 23 additions & 0 deletions charts/tock/charts/bot-admin/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/tock/charts/bot-admin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: bot-admin
description: Bot admin of tock
type: application
version: 0.1.0
appVersion: "latest"
1 change: 1 addition & 0 deletions charts/tock/charts/bot-admin/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.config" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/bot-admin/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.deployment" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/bot-admin/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.service" . }}
60 changes: 60 additions & 0 deletions charts/tock/charts/bot-admin/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
replicaCount: 1

image:
repository: tock/bot_admin
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

configMap: |-
tock_mongo_url: "{{ include "tock.mongoUrl" . }}"
nlp_duckling_url: "http://{{ .Release.Name }}-duckling:8080"
tock_env: prod
tock_bot_admin_rest_default_base_url: "http://{{ .Release.Name }}-bot-api:8080"
tock_bot_compiler_service_url: "http://{{ .Release.Name }}-kotlin-compiler:8080"
tock_configuration_bot_default_base_url: "http://{{ .Release.Name }}-bot-api:8080"
tock_bot_api: "true"
tock_https_env: "false"
adminverticle_body_limit: "-1"

healthEndpoint: "/rest/admin/healthcheck"
23 changes: 23 additions & 0 deletions charts/tock/charts/bot-api/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/tock/charts/bot-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: bot-api
description: Bot api of tock
type: application
version: 0.1.0
appVersion: "latest"
1 change: 1 addition & 0 deletions charts/tock/charts/bot-api/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.config" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/bot-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.deployment" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/bot-api/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.service" . }}
57 changes: 57 additions & 0 deletions charts/tock/charts/bot-api/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
replicaCount: 1

image:
repository: tock/bot_api
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

configMap: |-
tock_mongo_url: "{{ include "tock.mongoUrl" . }}"
tock_nlp_service_url: http://{{ .Release.Name }}-nlp-api:8080
tock_env: prod
tock_websocket_enabled: "true"

healthEndpoint: "/healthcheck"

serviceDependencies: ["nlp-api"]
23 changes: 23 additions & 0 deletions charts/tock/charts/build-worker/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/tock/charts/build-worker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: build-worker
description: Worker
type: application
version: 0.1.0
appVersion: "latest"
1 change: 1 addition & 0 deletions charts/tock/charts/build-worker/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.config" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/build-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.deployment" . }}
1 change: 1 addition & 0 deletions charts/tock/charts/build-worker/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tock.service" . }}
53 changes: 53 additions & 0 deletions charts/tock/charts/build-worker/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
replicaCount: 1

image:
repository: tock/build_worker
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

configMap: |-
tock_mongo_url: "{{ include "tock.mongoUrl" . }}"
tock_env: prod

healthEndpoint: "/healthcheck"
Loading