diff --git a/.gitignore b/.gitignore index 84cac0a..5ff233b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ tock-mongo-data/ ./kind +.idea diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cff9f84 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 0591169..9728125 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/charts/tock/.helmignore b/charts/tock/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/.helmignore @@ -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/ diff --git a/charts/tock/Chart.yaml b/charts/tock/Chart.yaml new file mode 100644 index 0000000..5926f7b --- /dev/null +++ b/charts/tock/Chart.yaml @@ -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" diff --git a/charts/tock/charts/bot-admin/.helmignore b/charts/tock/charts/bot-admin/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/bot-admin/.helmignore @@ -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/ diff --git a/charts/tock/charts/bot-admin/Chart.yaml b/charts/tock/charts/bot-admin/Chart.yaml new file mode 100644 index 0000000..91f8f25 --- /dev/null +++ b/charts/tock/charts/bot-admin/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: bot-admin +description: Bot admin of tock +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/charts/tock/charts/bot-admin/templates/configmap.yaml b/charts/tock/charts/bot-admin/templates/configmap.yaml new file mode 100644 index 0000000..41dbfa8 --- /dev/null +++ b/charts/tock/charts/bot-admin/templates/configmap.yaml @@ -0,0 +1 @@ +{{ include "tock.config" . }} diff --git a/charts/tock/charts/bot-admin/templates/deployment.yaml b/charts/tock/charts/bot-admin/templates/deployment.yaml new file mode 100644 index 0000000..3c50feb --- /dev/null +++ b/charts/tock/charts/bot-admin/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "tock.deployment" . }} diff --git a/charts/tock/charts/bot-admin/templates/service.yaml b/charts/tock/charts/bot-admin/templates/service.yaml new file mode 100644 index 0000000..edfd6c1 --- /dev/null +++ b/charts/tock/charts/bot-admin/templates/service.yaml @@ -0,0 +1 @@ +{{ include "tock.service" . }} diff --git a/charts/tock/charts/bot-admin/values.yaml b/charts/tock/charts/bot-admin/values.yaml new file mode 100644 index 0000000..2f117bb --- /dev/null +++ b/charts/tock/charts/bot-admin/values.yaml @@ -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" \ No newline at end of file diff --git a/charts/tock/charts/bot-api/.helmignore b/charts/tock/charts/bot-api/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/bot-api/.helmignore @@ -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/ diff --git a/charts/tock/charts/bot-api/Chart.yaml b/charts/tock/charts/bot-api/Chart.yaml new file mode 100644 index 0000000..42f4a6e --- /dev/null +++ b/charts/tock/charts/bot-api/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: bot-api +description: Bot api of tock +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/charts/tock/charts/bot-api/templates/configmap.yaml b/charts/tock/charts/bot-api/templates/configmap.yaml new file mode 100644 index 0000000..41dbfa8 --- /dev/null +++ b/charts/tock/charts/bot-api/templates/configmap.yaml @@ -0,0 +1 @@ +{{ include "tock.config" . }} diff --git a/charts/tock/charts/bot-api/templates/deployment.yaml b/charts/tock/charts/bot-api/templates/deployment.yaml new file mode 100644 index 0000000..3c50feb --- /dev/null +++ b/charts/tock/charts/bot-api/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "tock.deployment" . }} diff --git a/charts/tock/charts/bot-api/templates/service.yaml b/charts/tock/charts/bot-api/templates/service.yaml new file mode 100644 index 0000000..edfd6c1 --- /dev/null +++ b/charts/tock/charts/bot-api/templates/service.yaml @@ -0,0 +1 @@ +{{ include "tock.service" . }} diff --git a/charts/tock/charts/bot-api/values.yaml b/charts/tock/charts/bot-api/values.yaml new file mode 100644 index 0000000..c833b62 --- /dev/null +++ b/charts/tock/charts/bot-api/values.yaml @@ -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"] diff --git a/charts/tock/charts/build-worker/.helmignore b/charts/tock/charts/build-worker/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/build-worker/.helmignore @@ -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/ diff --git a/charts/tock/charts/build-worker/Chart.yaml b/charts/tock/charts/build-worker/Chart.yaml new file mode 100644 index 0000000..09f094f --- /dev/null +++ b/charts/tock/charts/build-worker/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: build-worker +description: Worker +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/charts/tock/charts/build-worker/templates/configmap.yaml b/charts/tock/charts/build-worker/templates/configmap.yaml new file mode 100644 index 0000000..41dbfa8 --- /dev/null +++ b/charts/tock/charts/build-worker/templates/configmap.yaml @@ -0,0 +1 @@ +{{ include "tock.config" . }} diff --git a/charts/tock/charts/build-worker/templates/deployment.yaml b/charts/tock/charts/build-worker/templates/deployment.yaml new file mode 100644 index 0000000..3c50feb --- /dev/null +++ b/charts/tock/charts/build-worker/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "tock.deployment" . }} diff --git a/charts/tock/charts/build-worker/templates/service.yaml b/charts/tock/charts/build-worker/templates/service.yaml new file mode 100644 index 0000000..edfd6c1 --- /dev/null +++ b/charts/tock/charts/build-worker/templates/service.yaml @@ -0,0 +1 @@ +{{ include "tock.service" . }} diff --git a/charts/tock/charts/build-worker/values.yaml b/charts/tock/charts/build-worker/values.yaml new file mode 100644 index 0000000..818da74 --- /dev/null +++ b/charts/tock/charts/build-worker/values.yaml @@ -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" \ No newline at end of file diff --git a/charts/tock/charts/duckling/.helmignore b/charts/tock/charts/duckling/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/duckling/.helmignore @@ -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/ diff --git a/charts/tock/charts/duckling/Chart.yaml b/charts/tock/charts/duckling/Chart.yaml new file mode 100644 index 0000000..4bc6f2e --- /dev/null +++ b/charts/tock/charts/duckling/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: duckling +description: Duckling +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/charts/tock/charts/duckling/templates/configmap.yaml b/charts/tock/charts/duckling/templates/configmap.yaml new file mode 100644 index 0000000..41dbfa8 --- /dev/null +++ b/charts/tock/charts/duckling/templates/configmap.yaml @@ -0,0 +1 @@ +{{ include "tock.config" . }} diff --git a/charts/tock/charts/duckling/templates/deployment.yaml b/charts/tock/charts/duckling/templates/deployment.yaml new file mode 100644 index 0000000..3c50feb --- /dev/null +++ b/charts/tock/charts/duckling/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "tock.deployment" . }} diff --git a/charts/tock/charts/duckling/templates/service.yaml b/charts/tock/charts/duckling/templates/service.yaml new file mode 100644 index 0000000..edfd6c1 --- /dev/null +++ b/charts/tock/charts/duckling/templates/service.yaml @@ -0,0 +1 @@ +{{ include "tock.service" . }} diff --git a/charts/tock/charts/duckling/values.yaml b/charts/tock/charts/duckling/values.yaml new file mode 100644 index 0000000..645504d --- /dev/null +++ b/charts/tock/charts/duckling/values.yaml @@ -0,0 +1,53 @@ +--- +replicaCount: 1 + +image: + repository: tock/duckling + 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" diff --git a/charts/tock/charts/kotlin-compiler/.helmignore b/charts/tock/charts/kotlin-compiler/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/.helmignore @@ -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/ diff --git a/charts/tock/charts/kotlin-compiler/Chart.yaml b/charts/tock/charts/kotlin-compiler/Chart.yaml new file mode 100644 index 0000000..b65a013 --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: kotlin-compiler +description: Kotlin compiler +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/charts/tock/charts/kotlin-compiler/templates/configmap.yaml b/charts/tock/charts/kotlin-compiler/templates/configmap.yaml new file mode 100644 index 0000000..41dbfa8 --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/templates/configmap.yaml @@ -0,0 +1 @@ +{{ include "tock.config" . }} diff --git a/charts/tock/charts/kotlin-compiler/templates/deployment.yaml b/charts/tock/charts/kotlin-compiler/templates/deployment.yaml new file mode 100644 index 0000000..3c50feb --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "tock.deployment" . }} diff --git a/charts/tock/charts/kotlin-compiler/templates/service.yaml b/charts/tock/charts/kotlin-compiler/templates/service.yaml new file mode 100644 index 0000000..edfd6c1 --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/templates/service.yaml @@ -0,0 +1 @@ +{{ include "tock.service" . }} diff --git a/charts/tock/charts/kotlin-compiler/values.yaml b/charts/tock/charts/kotlin-compiler/values.yaml new file mode 100644 index 0000000..6dd556d --- /dev/null +++ b/charts/tock/charts/kotlin-compiler/values.yaml @@ -0,0 +1,53 @@ +--- +replicaCount: 1 + +image: + repository: tock/kotlin_compiler + 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_env: prod + tock_kotlin_compiler_classpath: /maven + +healthEndpoint: "/healthcheck" diff --git a/charts/tock/charts/mongo/.helmignore b/charts/tock/charts/mongo/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/tock/charts/mongo/.helmignore @@ -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/ diff --git a/charts/tock/charts/mongo/Chart.yaml b/charts/tock/charts/mongo/Chart.yaml new file mode 100644 index 0000000..c925b95 --- /dev/null +++ b/charts/tock/charts/mongo/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: mongo +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "3.6" diff --git a/charts/tock/charts/mongo/files/init-mongo.sh b/charts/tock/charts/mongo/files/init-mongo.sh new file mode 100644 index 0000000..e512e66 --- /dev/null +++ b/charts/tock/charts/mongo/files/init-mongo.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Script to init mongo cluster + +if [ -z "${MONGO_SVC}" ]; then + echo "Please specify MONGO_SVC variable" ; exit 1 +fi + +echo "Waiting for startup.." +for i in 0 1 2 +do + until mongo --host ${MONGO_SVC}-${i}.${MONGO_SVC}:27017 --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do + printf '.' + sleep 1 + done + echo ; echo "Node $i started" +done +echo "All node Started.." + +echo setup.sh time now: `date +"%T" ` + +mongo --host ${MONGO_SVC}-0.${MONGO_SVC}:27017 <=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }}-bot-admin + port: + number: 8080 + {{- end }} +{{- end }} diff --git a/charts/tock/templates/serviceaccount.yaml b/charts/tock/templates/serviceaccount.yaml new file mode 100644 index 0000000..9159bb8 --- /dev/null +++ b/charts/tock/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "tock.serviceAccountName" . }} + labels: + {{- include "tock.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/tock/values.yaml b/charts/tock/values.yaml new file mode 100644 index 0000000..7e10509 --- /dev/null +++ b/charts/tock/values.yaml @@ -0,0 +1,87 @@ +# Default values for tock. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +configMap: |- + # defined in sub charts + +serviceDependencies: [] \ No newline at end of file