AlfrescoArchive / activiti-cloud-charts

Helm Charts for Activiti cloud Apps
Apache License 2.0
29 stars 28 forks source link

Common chart to rule values with Helm #48

Closed igdianov closed 5 years ago

igdianov commented 5 years ago

This PR fixes gateway host and keycloak url values duplication problem, so that users can install Activiti Helm chart with a single command:

helm install --name activiti . --set "global.gateway.host=activiti-cloud-gateway.1.2.3.4.nip.io"

global:
  gateway:
    host: "{{ .Release.Name }}.{{ .Release.Namespace }}.{{ .Values.global.gateway.domain }}"
    domain: "REPLACEME"

And then run helm upgrade example . --install --set global.gateway.domain=1.2.3.4.nip.io --debug to automatically install and expose all ingresses i.e. Keycloak, Gateway, Modeler, UI, Graphiql via example.jx-staging.1.2.3.4.nip.io single domain.

This will also enable to create Helm chart Quickstarts for Jx CI/CD import with templated values that use expose controller domain and http config, i.e.

expose: 
   config:
     domain: &domain "1.2.3.4.nip.io"
     http: &http true

global:
  keycloak:
    realm: "activiti"
    resource: "activiti"
    client: "activiti"
  gateway:
    host: "{{ .Release.Name }}.{{ .Release.Namespace }}.{{ .Values.global.gateway.domain }}"
    domain: *domain
    http: *http

This will enable to create Activiti Cloud Platform Quickstart: Activiti/Activiti#2448

By default, when Keycloak is deployed, it is exposed on the same Gateway host. It is possible to customize Keycloak host via global.keycloak.host value to expose its ingress on different subdomain, i.e. "activiti-keycloak.{{ .Release.Namespace }}.{{ .Values.global.gateway.domain }}".

NOTES:
               _   _       _ _   _    _____ _                 _
     /\       | | (_)     (_) | (_)  / ____| |               | |
    /  \   ___| |_ ___   ___| |_ _  | |    | | ___  _   _  __| |
   / /\ \ / __| __| \ \ / / | __| | | |    | |/ _ \| | | |/ _` |
  / ____ \ (__| |_| |\ V /| | |_| | | |____| | (_) | |_| | (_| |
 /_/    \_\___|\__|_| \_/ |_|\__|_|  \_____|_|\___/ \__,_|\__,_|
 Version: 1.0

Thank you for installing activiti-cloud-full-example-1.0.1

Your release is named example.

To learn more about the release, try:

  $ helm status example
  $ helm get example

Get the application URLs:

Activiti Keycloak : http://activiti-cloud-gateway.jx-staging.35.203.140.186.nip.io/auth
Activiti Gateway  : http://activiti-cloud-gateway.jx-staging.35.203.140.186.nip.io/
Activiti Modeler  : http://activiti-cloud-gateway.jx-staging.35.203.140.186.nip.io/activiti-cloud-modeling
Activiti GraphiQL : http://activiti-cloud-gateway.jx-staging.35.203.140.186.nip.io/graphiql

To see deployment status, try:

  $ kubectl get pods -n jx-staging

The common chart approach is based on the following projects, with some tweaks:

https://medium.com/devopslinks/dry-helm-charts-for-micro-services-db3a1d6ecb80

This approach should be combined with https://github.com/helm/charts/tree/master/incubator/common to enable DRY best practices and eliminate resources and values duplication amount peer and parent global values.