diff --git a/deployment/README.md b/deployment/README.md index 02a12d9fc..d3cbdf4d9 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -80,3 +80,13 @@ prod cluster** - `kubectl delete -f .` - To not delete the persistent volumes (Document indexes and Users), specify the specific `.yaml` files instead of `.` without specifying delete on persistent-volumes.yaml. + +### Using Helm to deploy to an existing cluster + +Onyx has a helm chart that is convenient to install all services to an existing Kubernetes cluster. To install: + +* Currently the helm chart is not published so to install, clone the repo. +* Configure access to the cluster via kubectl. Ensure the kubectl context is set to the cluster that you want to use +* The default secrets, environment variables and other service level configuration are stored in `deployment/helm/charts/onyx/values.yml`. You may create another `override.yml` +* `cd deployment/helm/charts/onyx` and run `helm install onyx -n onyx -f override.yaml .`. This will install onyx on the cluster under the `onyx` namespace. +* Check the status of the deploy using `kubectl get pods -n onyx` \ No newline at end of file diff --git a/deployment/helm/charts/onyx/templates/ingress-api.yaml b/deployment/helm/charts/onyx/templates/ingress-api.yaml new file mode 100644 index 000000000..9349d9527 --- /dev/null +++ b/deployment/helm/charts/onyx/templates/ingress-api.yaml @@ -0,0 +1,27 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "onyx-stack.fullname" . }}-ingress-api + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/use-regex: "true" + cert-manager.io/cluster-issuer: {{ include "onyx-stack.fullname" . }}-letsencrypt +spec: + rules: + - host: {{ .Values.ingress.api.host }} + http: + paths: + - path: /api(/|$)(.*) + pathType: Prefix + backend: + service: + name: {{ include "onyx-stack.fullname" . }}-api-service + port: + number: {{ .Values.api.service.servicePort }} + tls: + - hosts: + - {{ .Values.ingress.api.host }} + secretName: {{ include "onyx-stack.fullname" . }}-ingress-api-tls +{{- end }} \ No newline at end of file diff --git a/deployment/helm/charts/onyx/templates/ingress-webserver.yaml b/deployment/helm/charts/onyx/templates/ingress-webserver.yaml new file mode 100644 index 000000000..079085311 --- /dev/null +++ b/deployment/helm/charts/onyx/templates/ingress-webserver.yaml @@ -0,0 +1,26 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "onyx-stack.fullname" . }}-ingress-webserver + annotations: + kubernetes.io/ingress.class: nginx + cert-manager.io/cluster-issuer: {{ include "onyx-stack.fullname" . }}-letsencrypt + kubernetes.io/tls-acme: "true" +spec: + rules: + - host: {{ .Values.ingress.webserver.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "onyx-stack.fullname" . }}-webserver + port: + number: {{ .Values.webserver.service.servicePort }} + tls: + - hosts: + - {{ .Values.ingress.webserver.host }} + secretName: {{ include "onyx-stack.fullname" . }}-ingress-webserver-tls +{{- end }} \ No newline at end of file diff --git a/deployment/helm/charts/onyx/templates/lets-encrypt.yaml b/deployment/helm/charts/onyx/templates/lets-encrypt.yaml new file mode 100644 index 000000000..b21f9b148 --- /dev/null +++ b/deployment/helm/charts/onyx/templates/lets-encrypt.yaml @@ -0,0 +1,20 @@ +{{- if .Values.letsencrypt.enabled -}} +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: {{ include "onyx-stack.fullname" . }}-letsencrypt +spec: + acme: + # The ACME server URL + server: https://acme-v02.api.letsencrypt.org/directory + # Email address used for ACME registration + email: {{ .Values.letsencrypt.email }} + # Name of a secret used to store the ACME account private key + privateKeySecretRef: + name: {{ include "onyx-stack.fullname" . }}-letsencrypt + # Enable the HTTP-01 challenge provider + solvers: + - http01: + ingress: + class: nginx +{{- end }} \ No newline at end of file diff --git a/deployment/helm/charts/onyx/values.yaml b/deployment/helm/charts/onyx/values.yaml index ba2bed085..44bbc6dca 100644 --- a/deployment/helm/charts/onyx/values.yaml +++ b/deployment/helm/charts/onyx/values.yaml @@ -376,22 +376,17 @@ redis: existingSecret: onyx-secrets existingSecretPasswordKey: redis_password -# 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 +ingress: + enabled: false + className: "" + api: + host: onyx.local + webserver: + host: onyx.local +letsencrypt: + enabled: false + email: "abc@abc.com" auth: # existingSecret onyx-secret for storing smtp, oauth, slack, and other secrets