From f45f02403077a89963a62c79772447b6369b2574 Mon Sep 17 00:00:00 2001 From: aisuko Date: Fri, 29 Oct 2021 17:02:08 +0800 Subject: [PATCH] Rebuild the charts for Meshery and the meshery-operator as the primary chart Signed-off-by: aisuko --- .github/workflows/helm-chart-releaser.yml | 4 +- Makefile | 6 +- .../helm/meshery-operator/.helmignore | 22 ++ .../helm/meshery-operator/Chart.lock | 36 ++++ .../helm/meshery-operator/Chart.yaml | 90 ++++++++ .../helm/meshery-operator/README.md | 112 ++++++++++ .../charts/meshery-app-mesh/.helmignore | 22 ++ .../charts/meshery-app-mesh/Chart.yaml | 32 +++ .../charts/meshery-app-mesh/README.md | 45 ++++ .../meshery-app-mesh/templates/NOTES.txt | 21 ++ .../meshery-app-mesh/templates/_helpers.tpl | 67 ++++++ .../templates/deployment.yaml | 70 +++++++ .../meshery-app-mesh/templates/ingress.yaml | 42 ++++ .../meshery-app-mesh/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-app-mesh/values.yaml | 85 ++++++++ .../charts/meshery-broker/.helmignore | 23 +++ .../charts/meshery-broker/Chart.yaml | 14 ++ .../charts/meshery-broker/README.md | 21 ++ .../templates/meshery_v1alpha1_broker_cr.tpl | 7 + .../charts/meshery-broker/values.yaml | 2 + .../charts/meshery-consul/.helmignore | 22 ++ .../charts/meshery-consul/Chart.yaml | 34 ++++ .../charts/meshery-consul/README.md | 46 +++++ .../charts/meshery-consul/templates/NOTES.txt | 21 ++ .../meshery-consul/templates/_helpers.tpl | 67 ++++++ .../meshery-consul/templates/deployment.yaml | 70 +++++++ .../meshery-consul/templates/ingress.yaml | 42 ++++ .../meshery-consul/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-consul/values.yaml | 86 ++++++++ .../charts/meshery-cpx/.helmignore | 22 ++ .../charts/meshery-cpx/Chart.yaml | 32 +++ .../charts/meshery-cpx/README.md | 44 ++++ .../charts/meshery-cpx/templates/NOTES.txt | 21 ++ .../charts/meshery-cpx/templates/_helpers.tpl | 67 ++++++ .../meshery-cpx/templates/deployment.yaml | 70 +++++++ .../charts/meshery-cpx/templates/ingress.yaml | 42 ++++ .../charts/meshery-cpx/templates/service.yaml | 18 ++ .../meshery-cpx/templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-cpx/values.yaml | 84 ++++++++ .../charts/meshery-istio/.helmignore | 22 ++ .../charts/meshery-istio/Chart.yaml | 32 +++ .../charts/meshery-istio/README.md | 45 ++++ .../charts/meshery-istio/templates/NOTES.txt | 21 ++ .../meshery-istio/templates/_helpers.tpl | 67 ++++++ .../meshery-istio/templates/deployment.yaml | 70 +++++++ .../meshery-istio/templates/ingress.yaml | 42 ++++ .../meshery-istio/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-istio/values.yaml | 85 ++++++++ .../charts/meshery-kuma/.helmignore | 22 ++ .../charts/meshery-kuma/Chart.yaml | 33 +++ .../charts/meshery-kuma/README.md | 47 +++++ .../charts/meshery-kuma/templates/NOTES.txt | 21 ++ .../meshery-kuma/templates/_helpers.tpl | 67 ++++++ .../meshery-kuma/templates/deployment.yaml | 69 +++++++ .../meshery-kuma/templates/ingress.yaml | 42 ++++ .../meshery-kuma/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-kuma/values.yaml | 89 ++++++++ .../charts/meshery-linkerd/.helmignore | 22 ++ .../charts/meshery-linkerd/Chart.yaml | 33 +++ .../charts/meshery-linkerd/README.md | 46 +++++ .../meshery-linkerd/templates/NOTES.txt | 21 ++ .../meshery-linkerd/templates/_helpers.tpl | 67 ++++++ .../meshery-linkerd/templates/deployment.yaml | 69 +++++++ .../meshery-linkerd/templates/ingress.yaml | 42 ++++ .../meshery-linkerd/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-linkerd/values.yaml | 86 ++++++++ .../charts/meshery-meshsync/.helmignore | 23 +++ .../charts/meshery-meshsync/Chart.yaml | 14 ++ .../charts/meshery-meshsync/README.md | 23 +++ .../templates/meshery_v1alpha1_broker_cr.tpl | 11 + .../charts/meshery-meshsync/values.yaml | 5 + .../charts/meshery-nginx-sm/.helmignore | 22 ++ .../charts/meshery-nginx-sm/Chart.yaml | 33 +++ .../charts/meshery-nginx-sm/README.md | 49 +++++ .../meshery-nginx-sm/templates/NOTES.txt | 21 ++ .../meshery-nginx-sm/templates/_helpers.tpl | 67 ++++++ .../templates/deployment.yaml | 67 ++++++ .../meshery-nginx-sm/templates/ingress.yaml | 42 ++++ .../meshery-nginx-sm/templates/service.yaml | 17 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-nginx-sm/values.yaml | 91 +++++++++ .../charts/meshery-nsm/.helmignore | 22 ++ .../charts/meshery-nsm/Chart.yaml | 33 +++ .../charts/meshery-nsm/README.md | 47 +++++ .../charts/meshery-nsm/templates/NOTES.txt | 21 ++ .../charts/meshery-nsm/templates/_helpers.tpl | 67 ++++++ .../meshery-nsm/templates/deployment.yaml | 69 +++++++ .../charts/meshery-nsm/templates/ingress.yaml | 42 ++++ .../charts/meshery-nsm/templates/service.yaml | 18 ++ .../meshery-nsm/templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-nsm/values.yaml | 88 ++++++++ .../charts/meshery-osm/.helmignore | 22 ++ .../charts/meshery-osm/Chart.yaml | 33 +++ .../charts/meshery-osm/README.md | 47 +++++ .../charts/meshery-osm/templates/NOTES.txt | 21 ++ .../charts/meshery-osm/templates/_helpers.tpl | 67 ++++++ .../meshery-osm/templates/deployment.yaml | 69 +++++++ .../charts/meshery-osm/templates/ingress.yaml | 42 ++++ .../charts/meshery-osm/templates/service.yaml | 18 ++ .../meshery-osm/templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-osm/values.yaml | 88 ++++++++ .../charts/meshery-traefik-mesh/.helmignore | 22 ++ .../charts/meshery-traefik-mesh/Chart.yaml | 32 +++ .../charts/meshery-traefik-mesh/README.md | 45 ++++ .../meshery-traefik-mesh/templates/NOTES.txt | 21 ++ .../templates/_helpers.tpl | 67 ++++++ .../templates/deployment.yaml | 70 +++++++ .../templates/ingress.yaml | 42 ++++ .../templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../charts/meshery-traefik-mesh/values.yaml | 85 ++++++++ .../charts/meshery/.helmignore | 22 ++ .../charts/meshery/Chart.yaml | 57 ++++++ .../meshery-operator/charts/meshery/README.md | 54 +++++ .../charts/meshery/templates/NOTES.txt | 22 ++ .../charts/meshery/templates/_helpers.tpl | 63 ++++++ .../charts/meshery/templates/clusterrole.yaml | 16 ++ .../meshery/templates/clusterrolebinding.yaml | 14 ++ .../charts/meshery/templates/deployment.yaml | 70 +++++++ .../charts/meshery/templates/gateway.yaml | 16 ++ .../charts/meshery/templates/ingress.yaml | 42 ++++ .../charts/meshery/templates/service.yaml | 18 ++ .../meshery/templates/serviceaccount.yaml | 7 + .../templates/tests/test-connection.yaml | 17 ++ .../meshery/templates/virtualservice.yaml | 20 ++ .../charts/meshery/values.yaml | 104 ++++++++++ .../helm/meshery-operator/crds/crds.yaml | 192 ++++++++++++++++++ .../helm/meshery-operator/templates/NOTES.txt | 21 ++ .../meshery-operator/templates/_helpers.tpl | 63 ++++++ .../templates/clusterrole.yaml | 116 +++++++++++ .../templates/clusterrolebinding.yaml | 61 ++++++ .../templates/deployment.yaml | 85 ++++++++ .../meshery-operator/templates/ingress.yaml | 42 ++++ .../meshery-operator/templates/service.yaml | 18 ++ .../templates/serviceaccount.yaml | 9 + .../templates/tests/test-connection.yaml | 17 ++ .../helm/meshery-operator/values.yaml | 176 ++++++++++++++++ 152 files changed, 6060 insertions(+), 2 deletions(-) create mode 100644 install/kubernetes/helm/meshery-operator/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/Chart.lock create mode 100644 install/kubernetes/helm/meshery-operator/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-broker/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-broker/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-broker/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-broker/templates/meshery_v1alpha1_broker_cr.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-broker/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-consul/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-cpx/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-istio/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-kuma/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/templates/meshery_v1alpha1_broker_cr.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-nsm/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-osm/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/.helmignore create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/Chart.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/README.md create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrole.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrolebinding.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/gateway.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/templates/virtualservice.yaml create mode 100644 install/kubernetes/helm/meshery-operator/charts/meshery/values.yaml create mode 100644 install/kubernetes/helm/meshery-operator/crds/crds.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/NOTES.txt create mode 100644 install/kubernetes/helm/meshery-operator/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/meshery-operator/templates/clusterrole.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/clusterrolebinding.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/deployment.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/ingress.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/service.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/serviceaccount.yaml create mode 100644 install/kubernetes/helm/meshery-operator/templates/tests/test-connection.yaml create mode 100644 install/kubernetes/helm/meshery-operator/values.yaml diff --git a/.github/workflows/helm-chart-releaser.yml b/.github/workflows/helm-chart-releaser.yml index 76dc0294e00..54ce47476e1 100644 --- a/.github/workflows/helm-chart-releaser.yml +++ b/.github/workflows/helm-chart-releaser.yml @@ -29,8 +29,10 @@ jobs: with: version: 'v3.6.0' # default is latest stable id: install - - name: validate + - name: validate meshery run: helm lint install/kubernetes/helm/meshery --with-subcharts + - name: validate meshery-operator + run: helm lint install/kubernetes/helm/meshery-operator --with-subcharts release-chart: runs-on: ubuntu-latest if: github.event_name != 'pull_request' diff --git a/Makefile b/Makefile index 26ec92ba91f..e61f5c04afb 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ MESHERY_CLOUD_STAGING="https://staging-meshery.layer5.io" GIT_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`) GIT_COMMITSHA=$(shell git rev-list -1 HEAD) RELEASE_CHANNEL="edge" +# Please do not remove the code below(the code already removed several times), those constant will help on local CI check, like $ make chart-readme or $ make golangci-run +GOPATH = $(shell go env GOPATH) +GOBIN = $(GOPATH)/bin # Build the CLI for Meshery - `mesheryctl`. # Build Meshery inside of a multi-stage Docker container. @@ -161,7 +164,8 @@ docker-docs: .PHONY: chart-readme chart-readme: - go run github.com/norwoodj/helm-docs/cmd/helm-docs -c install/kubernetes/helm/ + GO111MODULE=on go get github.com/norwoodj/helm-docs/cmd/helm-docs + $(GOPATH)/bin/helm-docs -c install/kubernetes/helm/meshery-operator swagger-spec: swagger generate spec -o ./helpers/swagger.yaml --scan-models diff --git a/install/kubernetes/helm/meshery-operator/.helmignore b/install/kubernetes/helm/meshery-operator/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/Chart.lock b/install/kubernetes/helm/meshery-operator/Chart.lock new file mode 100644 index 00000000000..6bd8d570aaf --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/Chart.lock @@ -0,0 +1,36 @@ +dependencies: +- name: meshery-istio + repository: "" + version: 2.1.2 +- name: meshery-linkerd + repository: "" + version: 2.1.2 +- name: meshery-consul + repository: "" + version: 2.1.2 +- name: meshery-kuma + repository: "" + version: 2.1.2 +- name: meshery-osm + repository: "" + version: 2.1.2 +- name: meshery-nsm + repository: "" + version: 2.1.2 +- name: meshery-traefik-mesh + repository: "" + version: 2.1.2 +- name: meshery-cpx + repository: "" + version: 2.1.2 +- name: meshery-nginx-sm + repository: "" + version: 2.1.2 +- name: meshery-app-mesh + repository: "" + version: 2.1.2 +- name: meshery + repository: "" + version: 2.1.2 +digest: sha256:b1230f6f0c6dd0017f96599eaaf38d8dc6d4127dc285a06464d5e04608754abf +generated: "2021-10-29T15:10:39.691795+08:00" diff --git a/install/kubernetes/helm/meshery-operator/Chart.yaml b/install/kubernetes/helm/meshery-operator/Chart.yaml new file mode 100644 index 00000000000..05b49497803 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/Chart.yaml @@ -0,0 +1,90 @@ +apiVersion: v2 +name: meshery-operator +description: Meshery Operator chart. +icon: https://meshery.io/images/logos/meshery-logo.png +source: + - https://github.com/layer5io/meshery-operator +keywords: + - meshery + - meshery-istio + - meshery-linkerd + - meshery-consul + - meshery-kuma + - meshery-osm + - meshery-nsm + - meshery-traefik-mesh + - meshery-cpx + - meshery-nginx-sm + - meshery-app-mesh + - meshery-server + - meshery-broker + - meshery-meshsync +deprecated: false + +# 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. +version: 0.6.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. +# TODO: Need the confirm the image tag. +appVersion: 0.6.0 + +dependencies: +- name: meshery-istio + version: 2.1.2 + condition: meshery-istio.enabled +- name: meshery-linkerd + version: 2.1.2 + condition: meshery-linkerd.enabled +- name: meshery-consul + version: 2.1.2 + condition: meshery-consul.enabled +- name: meshery-kuma + version: 2.1.2 + condition: meshery-kuma.enabled +- name: meshery-osm + version: 2.1.2 + condition: meshery-osm.enabled +- name: meshery-nsm + version: 2.1.2 + condition: meshery-nsm.enabled +- name: meshery-traefik-mesh + version: 2.1.2 + condition: meshery-traefik-mesh.enabled +- name: meshery-cpx + version: 2.1.2 + condition: meshery-cpx.enabled +- name: meshery-nginx-sm + version: 2.1.2 + condition: meshery-nginx-sm.enabled +- name: meshery-app-mesh + version: 2.1.2 + condition: meshery-app-mesh.enabled +- name: meshery + version: 2.1.2 + condition: meshery.enabled +- name: meshery-broker + version: 0.1.0 + condition: meshery-broker.enabled +- name: meshery-meshsync + version: 0.1.0 + condition: meshery-meshsync.enabled + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: leecalcote@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/README.md b/install/kubernetes/helm/meshery-operator/README.md new file mode 100644 index 00000000000..a5cc620716f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/README.md @@ -0,0 +1,112 @@ +# meshery-operator + +![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.6.0](https://img.shields.io/badge/AppVersion-0.6.0-informational?style=flat-square) + +Meshery Operator chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | leecalcote@gmail.com | | + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| | meshery | 2.1.2 | +| | meshery-app-mesh | 2.1.2 | +| | meshery-broker | 0.1.0 | +| | meshery-consul | 2.1.2 | +| | meshery-cpx | 2.1.2 | +| | meshery-istio | 2.1.2 | +| | meshery-kuma | 2.1.2 | +| | meshery-linkerd | 2.1.2 | +| | meshery-meshsync | 0.1.0 | +| | meshery-nginx-sm | 2.1.2 | +| | meshery-nsm | 2.1.2 | +| | meshery-osm | 2.1.2 | +| | meshery-traefik-mesh | 2.1.2 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths | list | `[]` | | +| ingress.tls | list | `[]` | | +| kubeRbac.args[0] | string | `"--secure-listen-address=0.0.0.0:8443"` | | +| kubeRbac.args[1] | string | `"--upstream=http://127.0.0.1:8080/"` | | +| kubeRbac.args[2] | string | `"--logtostderr=false"` | | +| kubeRbac.args[3] | string | `"--v=10"` | | +| kubeRbac.image.pullPolicy | string | `"IfNotPresent"` | | +| kubeRbac.image.repository | string | `"gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0"` | | +| kubeRbac.name | string | `"kube-rbac-proxy"` | | +| meshery-app-mesh | object | `{"enabled":false,"fullnameOverride":"meshery-app-mesh","serviceAccountNameOverride":"meshery-server"}` | If need to use a different service accounts for the adapters, modify the serviceAccountNameOverride for the corresponding adapters here, or set the serviceAccountNameOverride to empty while setting the serviceAccount information in the sub-chart accordingly | +| meshery-broker.enabled | bool | `true` | | +| meshery-broker.fullnameOverride | string | `"meshery-broker"` | | +| meshery-broker.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-consul.enabled | bool | `true` | | +| meshery-consul.fullnameOverride | string | `"meshery-consul"` | | +| meshery-consul.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-cpx.enabled | bool | `false` | | +| meshery-cpx.fullnameOverride | string | `"meshery-cpx"` | | +| meshery-cpx.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-istio.enabled | bool | `true` | | +| meshery-istio.fullnameOverride | string | `"meshery-istio"` | | +| meshery-istio.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-kuma.enabled | bool | `true` | | +| meshery-kuma.fullnameOverride | string | `"meshery-kuma"` | | +| meshery-kuma.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-linkerd.enabled | bool | `true` | | +| meshery-linkerd.fullnameOverride | string | `"meshery-linkerd"` | | +| meshery-linkerd.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-meshsync.enabled | bool | `true` | | +| meshery-meshsync.fullnameOverride | string | `"meshery-meshsync"` | | +| meshery-meshsync.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-nginx-sm.enabled | bool | `false` | | +| meshery-nginx-sm.fullnameOverride | string | `"meshery-nginx-sm"` | | +| meshery-nginx-sm.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-nsm.enabled | bool | `false` | | +| meshery-nsm.fullnameOverride | string | `"meshery-nsm"` | | +| meshery-nsm.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-osm.enabled | bool | `true` | | +| meshery-osm.fullnameOverride | string | `"meshery-osm"` | | +| meshery-osm.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery-traefik-mesh.enabled | bool | `false` | | +| meshery-traefik-mesh.fullnameOverride | string | `"meshery-traefik-mesh"` | | +| meshery-traefik-mesh.serviceAccountNameOverride | string | `"meshery-server"` | | +| meshery.enabled | bool | `true` | | +| meshery.fullnameOverride | string | `"meshery-server"` | | +| meshery.serviceAccountNameOverride | string | `"meshery-server"` | | +| mesheryOperator.args[0] | string | `"--metrics-addr=127.0.0.1:8080"` | | +| mesheryOperator.args[1] | string | `"--enable-leader-election"` | | +| mesheryOperator.command[0] | string | `"/manager"` | | +| mesheryOperator.image.pullPolicy | string | `"IfNotPresent"` | | +| mesheryOperator.image.repository | string | `"layer5/meshery-operator:stable-latest"` | | +| mesheryOperator.name | string | `"manager"` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10000` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | string | `"create"` | | +| serviceAccount.name | string | `"meshery-operator"` | If not set and create is false, a name is generated using the fullname template | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/Chart.yaml new file mode 100644 index 00000000000..d4ae97f6ecf --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: meshery-app-mesh +description: Meshery Adapter for App Mesh chart. +source: + - https://github.com/layer5io/meshery-app-mesh + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: leecalcote@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/README.md new file mode 100644 index 00000000000..c8db8f124b6 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/README.md @@ -0,0 +1,45 @@ +# meshery-app-mesh + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for App Mesh chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| aisuko | urakiny@gmail.com | | +| leecalcote | leecalcote@gmail.com | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-app-mesh:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10005` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/NOTES.txt new file mode 100644 index 00000000000..f37d2800cbf --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-app-mesh.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-app-mesh.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-app-mesh.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-app-mesh.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10005 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/_helpers.tpl new file mode 100644 index 00000000000..f774e944e1f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-app-mesh.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 "meshery-app-mesh.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 "meshery-app-mesh.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-app-mesh.labels" -}} +helm.sh/chart: {{ include "meshery-app-mesh.chart" . }} +{{ include "meshery-app-mesh.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-app-mesh.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-app-mesh.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-app-mesh.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-app-mesh.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/deployment.yaml new file mode 100644 index 00000000000..cf4ac628e9f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-app-mesh.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-app-mesh.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-app-mesh.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-app-mesh.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-app-mesh.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-app-mesh image version + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10005 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/ingress.yaml new file mode 100644 index 00000000000..fc9383249c7 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-app-mesh.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-app-mesh.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/service.yaml new file mode 100644 index 00000000000..b870c12e549 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-app-mesh.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-app-mesh.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-app-mesh.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/serviceaccount.yaml new file mode 100644 index 00000000000..cf7fbec0d88 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-app-mesh.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-app-mesh.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..d97de56ceea --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-app-mesh.fullname" . }}-test-connection" + labels: +{{ include "meshery-app-mesh.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-app-mesh.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/values.yaml new file mode 100644 index 00000000000..ebe5a9e40d3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-app-mesh/values.yaml @@ -0,0 +1,85 @@ +# Default values for meshery-app-mesh. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-app-mesh:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10005 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-broker/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/.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/install/kubernetes/helm/meshery-operator/charts/meshery-broker/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/Chart.yaml new file mode 100644 index 00000000000..08490d934da --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: meshery-broker +description: Meshery Broker CR Chart +type: application +version: 0.1.0 +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: darrenlau + email: panyuenlau@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-broker/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/README.md new file mode 100644 index 00000000000..4b106c69617 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/README.md @@ -0,0 +1,21 @@ +# meshery-broker + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Broker CR Chart + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| darrenlau | panyuenlau@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| name | string | `"meshery-broker"` | | +| replica | int | `1` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-broker/templates/meshery_v1alpha1_broker_cr.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/templates/meshery_v1alpha1_broker_cr.tpl new file mode 100644 index 00000000000..f4c502e8332 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/templates/meshery_v1alpha1_broker_cr.tpl @@ -0,0 +1,7 @@ +apiVersion: meshery.layer5.io/v1alpha1 +kind: Broker +metadata: + name: {{ .Values.name }} + namespace: {{ .Release.Namespace }} +spec: + size: {{ .Values.replica }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-broker/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/values.yaml new file mode 100644 index 00000000000..2bb6392411f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-broker/values.yaml @@ -0,0 +1,2 @@ +name: meshery-broker +replica: 1 diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/Chart.yaml new file mode 100644 index 00000000000..b5eca5ffe8e --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/Chart.yaml @@ -0,0 +1,34 @@ +apiVersion: v2 +name: meshery-consul +description: Meshery Adapter for Consul chart. +source: + - https://github.com/layer5io/meshery-consul + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/README.md new file mode 100644 index 00000000000..65a13a39161 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/README.md @@ -0,0 +1,46 @@ +# meshery-consul + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Consul chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-consul:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10002` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/NOTES.txt new file mode 100644 index 00000000000..b4e9abf5b1a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-consul.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-consul.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-consul.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-consul.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10002 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/_helpers.tpl new file mode 100644 index 00000000000..1153c5e22d0 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-consul.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 "meshery-consul.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 "meshery-consul.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-consul.labels" -}} +helm.sh/chart: {{ include "meshery-consul.chart" . }} +{{ include "meshery-consul.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-consul.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-consul.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-consul.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-consul.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/deployment.yaml new file mode 100644 index 00000000000..1ecbada1652 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-consul.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-consul.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-consul.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-consul.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-consul.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-consul image version + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10002 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/ingress.yaml new file mode 100644 index 00000000000..a8dcae9885d --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-consul.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-consul.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/service.yaml new file mode 100644 index 00000000000..b3988bfba6c --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-consul.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-consul.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-consul.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/serviceaccount.yaml new file mode 100644 index 00000000000..7a144ac651d --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-consul.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-consul.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..22ef28abb81 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-consul.fullname" . }}-test-connection" + labels: +{{ include "meshery-consul.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-consul.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-consul/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/values.yaml new file mode 100644 index 00000000000..85548b5d883 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-consul/values.yaml @@ -0,0 +1,86 @@ +# Default values for meshery-consul. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-consul:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +# The serviceAccount info is used when the serviceAccountNameOverride is empty +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10002 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/Chart.yaml new file mode 100644 index 00000000000..0e61c798170 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: meshery-cpx +description: Meshery Adapter for Citrix chart. +source: + - https://github.com/layer5io/meshery-cpx + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: leecalcote@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/README.md new file mode 100644 index 00000000000..d8726e05955 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/README.md @@ -0,0 +1,44 @@ +# meshery-cpx + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Citrix chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| aisuko | urakiny@gmail.com | | +| leecalcote | leecalcote@gmail.com | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-cpx:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10008` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/NOTES.txt new file mode 100644 index 00000000000..9ccfe48ea73 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-cpx.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-cpx.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-cpx.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-cpx.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10008 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/_helpers.tpl new file mode 100644 index 00000000000..0b22b5c1252 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-cpx.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 "meshery-cpx.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 "meshery-cpx.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-cpx.labels" -}} +helm.sh/chart: {{ include "meshery-cpx.chart" . }} +{{ include "meshery-cpx.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-cpx.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-cpx.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-cpx.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-cpx.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/deployment.yaml new file mode 100644 index 00000000000..fc848693036 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-cpx.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-cpx.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-cpx.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-cpx.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-cpx.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-cpx image version + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10008 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/ingress.yaml new file mode 100644 index 00000000000..e282568a4ea --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-cpx.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-cpx.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/service.yaml new file mode 100644 index 00000000000..cdcf32bb081 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-cpx.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-cpx.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-cpx.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/serviceaccount.yaml new file mode 100644 index 00000000000..3c614254175 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-cpx.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-cpx.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..a67d1e6bf72 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-cpx.fullname" . }}-test-connection" + labels: +{{ include "meshery-cpx.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-cpx.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/values.yaml new file mode 100644 index 00000000000..3f1f9e03ffc --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-cpx/values.yaml @@ -0,0 +1,84 @@ +# Default values for meshery-cpx. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-cpx:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +# By default, this is provided by the top-level chart as "meshery-cpx" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10008 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/Chart.yaml new file mode 100644 index 00000000000..68337615e74 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: meshery-istio +description: Meshery Adapter for Istio chart. +source: + - https://github.com/layer5io/meshery-istio + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: leecalcote@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/README.md new file mode 100644 index 00000000000..61b0cb42baf --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/README.md @@ -0,0 +1,45 @@ +# meshery-istio + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Istio chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| aisuko | urakiny@gmail.com | | +| leecalcote | leecalcote@gmail.com | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-istio:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10000` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/NOTES.txt new file mode 100644 index 00000000000..c59be06473e --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-istio.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-istio.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-istio.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-istio.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10000 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/_helpers.tpl new file mode 100644 index 00000000000..4da40c36c68 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-istio.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 "meshery-istio.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 "meshery-istio.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-istio.labels" -}} +helm.sh/chart: {{ include "meshery-istio.chart" . }} +{{ include "meshery-istio.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-istio.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-istio.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-istio.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-istio.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/deployment.yaml new file mode 100644 index 00000000000..d797953c77a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-istio.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-istio.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-istio.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-istio.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-istio.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-istio image version + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10000 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/ingress.yaml new file mode 100644 index 00000000000..9ac4b1110f3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-istio.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-istio.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/service.yaml new file mode 100644 index 00000000000..b8a84a58308 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-istio.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-istio.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-istio.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/serviceaccount.yaml new file mode 100644 index 00000000000..9b01e1e7ea7 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-istio.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-istio.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..e65d397409b --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-istio.fullname" . }}-test-connection" + labels: +{{ include "meshery-istio.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-istio.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-istio/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/values.yaml new file mode 100644 index 00000000000..114af5141b3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-istio/values.yaml @@ -0,0 +1,85 @@ +# Default values for meshery-istio. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-istio:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10000 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/Chart.yaml new file mode 100644 index 00000000000..2e1078995cd --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: meshery-kuma +description: Meshery Adapter for Kuma. +source: + - https://github.com/layer5io/meshery-kuma + +deprecated: false +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/README.md new file mode 100644 index 00000000000..2bc6b5a9c10 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/README.md @@ -0,0 +1,47 @@ +# meshery-kuma + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Kuma. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-kuma:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| ports.http | int | `10007` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10007` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/NOTES.txt new file mode 100644 index 00000000000..f85f7e9717a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-kuma.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-kuma.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-kuma.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-kuma.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:{{ .Values.ports.http }} + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/_helpers.tpl new file mode 100644 index 00000000000..0d2cbc4fe93 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-kuma.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 "meshery-kuma.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 "meshery-kuma.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-kuma.labels" -}} +helm.sh/chart: {{ include "meshery-kuma.chart" . }} +{{ include "meshery-kuma.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-kuma.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-kuma.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-kuma.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-kuma.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/deployment.yaml new file mode 100644 index 00000000000..cc30439d81b --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-kuma.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-kuma.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-kuma.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-kuma.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-kuma.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.ports.http }} + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/ingress.yaml new file mode 100644 index 00000000000..07607392e25 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-kuma.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-kuma.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/service.yaml new file mode 100644 index 00000000000..79ca8007994 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-kuma.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-kuma.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-kuma.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/serviceaccount.yaml new file mode 100644 index 00000000000..540b5aa14b8 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-kuma.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "meshery-kuma.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..2dc0663f8ab --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-kuma.fullname" . }}-test-connection" + labels: +{{ include "meshery-kuma.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-kuma.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/values.yaml new file mode 100644 index 00000000000..9f44c2c71ae --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-kuma/values.yaml @@ -0,0 +1,89 @@ +# Default values for meshery-kuma. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-kuma:stable-latest + pullPolicy: Always + +ports: + http: 10007 + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +# The serviceAccount info is used when the serviceAccountNameOverride is empty +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10007 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/Chart.yaml new file mode 100644 index 00000000000..3d0c3db69e1 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: meshery-linkerd +description: Mesherylinkerd chart for deploying meshery-linkerd. +source: + - https://github.com/layer5io/meshery-linkerd + +deprecated: false +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/README.md new file mode 100644 index 00000000000..71f5a39e4a6 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/README.md @@ -0,0 +1,46 @@ +# meshery-linkerd + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Mesherylinkerd chart for deploying meshery-linkerd. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-linkerd:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10001` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/NOTES.txt new file mode 100644 index 00000000000..467388860c6 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-linkerd.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-linkerd.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-linkerd.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-linkerd.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10001 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/_helpers.tpl new file mode 100644 index 00000000000..a1928b77e17 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-linkerd.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 "meshery-linkerd.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 "meshery-linkerd.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-linkerd.labels" -}} +helm.sh/chart: {{ include "meshery-linkerd.chart" . }} +{{ include "meshery-linkerd.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-linkerd.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-linkerd.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-linkerd.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-linkerd.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/deployment.yaml new file mode 100644 index 00000000000..262fdb426d3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-linkerd.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-linkerd.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-linkerd.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-linkerd.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-linkerd.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10001 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/ingress.yaml new file mode 100644 index 00000000000..6e0f4b90393 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-linkerd.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-linkerd.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/service.yaml new file mode 100644 index 00000000000..2d0f27a19f6 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-linkerd.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-linkerd.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-linkerd.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/serviceaccount.yaml new file mode 100644 index 00000000000..08f5e366dbd --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-linkerd.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "meshery-linkerd.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..89896be72ca --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-linkerd.fullname" . }}-test-connection" + labels: +{{ include "meshery-linkerd.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-linkerd.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/values.yaml new file mode 100644 index 00000000000..5221ad4781e --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-linkerd/values.yaml @@ -0,0 +1,86 @@ +# Default values for meshery-linkerd. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-linkerd:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +# The serviceAccount info is used when the serviceAccountNameOverride is empty +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10001 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/.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/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/Chart.yaml new file mode 100644 index 00000000000..2bb62c91824 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: meshery-meshsync +description: Meshery MeshSync CR Chart +type: application +version: 0.1.0 +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: darrenlau + email: panyuenlau@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/README.md new file mode 100644 index 00000000000..d81937377aa --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/README.md @@ -0,0 +1,23 @@ +# meshery-meshsync + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery MeshSync CR Chart + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| darrenlau | panyuenlau@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| broker.name | string | `"meshery-broker"` | | +| broker.namespace | string | `"meshery"` | | +| name | string | `"meshery-meshsync"` | | +| replica | int | `1` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/templates/meshery_v1alpha1_broker_cr.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/templates/meshery_v1alpha1_broker_cr.tpl new file mode 100644 index 00000000000..c63bd4cf60f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/templates/meshery_v1alpha1_broker_cr.tpl @@ -0,0 +1,11 @@ +apiVersion: meshery.layer5.io/v1alpha1 +kind: MeshSync +metadata: + name: {{ .Values.name }} + namespace: {{ .Release.Namespace }} +spec: + size: {{ .Values.replica }} + broker: + native: + name: {{ .Values.broker.name }} + namespace: {{ .Values.broker.namespace }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/values.yaml new file mode 100644 index 00000000000..efab7d8354b --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-meshsync/values.yaml @@ -0,0 +1,5 @@ +name: meshery-meshsync +replica: 1 +broker: + name: meshery-broker + namespace: meshery diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/Chart.yaml new file mode 100644 index 00000000000..b9be8d39acf --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: meshery-nginx-sm +description: Meshery Adapter for NGINX Service Mesh. +source: + - https://github.com/layer5io/meshery-nginx-sm + +deprecated: false +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: darrenlau + email: panyuenlau@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/README.md new file mode 100644 index 00000000000..95bc67f1cdc --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/README.md @@ -0,0 +1,49 @@ +# meshery-nginx-sm + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for NGINX Service Mesh. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| darrenlau | panyuenlau@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations."kompose.cmd" | string | `"kompose convert -f ../docker-compose.yaml"` | | +| annotations."kompose.version" | string | `"1.17.0 ()"` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-nginx-sm:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| ports.http | int | `10010` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10010` | | +| service.targetPort | int | `10010` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/NOTES.txt new file mode 100644 index 00000000000..bea7c31e5f8 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-nginx-sm.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-nginx-sm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-nginx-sm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-nginx-sm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:{{ .Values.ports.http }} + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/_helpers.tpl new file mode 100644 index 00000000000..aa3f96419a1 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-nginx-sm.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 "meshery-nginx-sm.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 "meshery-nginx-sm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-nginx-sm.labels" -}} +helm.sh/chart: {{ include "meshery-nginx-sm.chart" . }} +{{ include "meshery-nginx-sm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-nginx-sm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-nginx-sm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-nginx-sm.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-nginx-sm.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/deployment.yaml new file mode 100644 index 00000000000..d6de43f3d22 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/deployment.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-nginx-sm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + io.kompose.service: {{ include "meshery-nginx-sm.fullname" . }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + io.kompose.service: {{ include "meshery-nginx-sm.fullname" . }} + template: + metadata: + labels: + io.kompose.service: {{ include "meshery-nginx-sm.fullname" . }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-nginx-sm.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.ports.http }} + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/ingress.yaml new file mode 100644 index 00000000000..782bd78651e --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-nginx-sm.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-nginx-sm.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/service.yaml new file mode 100644 index 00000000000..5d89d96e139 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-nginx-sm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + io.kompose.service: {{ include "meshery-nginx-sm.fullname" . }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} + name: "{{ .Values.service.port }}" + selector: + io.kompose.service: {{ include "meshery-nginx-sm.fullname" . }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/serviceaccount.yaml new file mode 100644 index 00000000000..fabd3f75be1 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-nginx-sm.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "meshery-nginx-sm.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..088b9c6065a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-nginx-sm.fullname" . }}-test-connection" + labels: +{{ include "meshery-nginx-sm.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-nginx-sm.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/values.yaml new file mode 100644 index 00000000000..1004390f695 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nginx-sm/values.yaml @@ -0,0 +1,91 @@ +# Default values for meshery-nginx-sm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-nginx-sm:stable-latest + pullPolicy: Always + +ports: + http: 10010 + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml + kompose.version: 1.17.0 () + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10010 + targetPort: 10010 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/Chart.yaml new file mode 100644 index 00000000000..04c977d8c36 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: meshery-nsm +description: Meshery Adapter for Network Service Mesh. +source: + - https://github.com/layer5io/meshery-nsm + +deprecated: false +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/README.md new file mode 100644 index 00000000000..d7137b99013 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/README.md @@ -0,0 +1,47 @@ +# meshery-nsm + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Network Service Mesh. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-nsm:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| ports.http | int | `10004` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10004` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/NOTES.txt new file mode 100644 index 00000000000..abeb562fde3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-nsm.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-nsm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-nsm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-nsm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:{{ .Values.ports.http }} + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/_helpers.tpl new file mode 100644 index 00000000000..63de3ab789f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-nsm.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 "meshery-nsm.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 "meshery-nsm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-nsm.labels" -}} +helm.sh/chart: {{ include "meshery-nsm.chart" . }} +{{ include "meshery-nsm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-nsm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-nsm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-nsm.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-nsm.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/deployment.yaml new file mode 100644 index 00000000000..9fbfdcf30e4 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-nsm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-nsm.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-nsm.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-nsm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-nsm.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.ports.http }} + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/ingress.yaml new file mode 100644 index 00000000000..f0d7a22a966 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-nsm.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-nsm.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/service.yaml new file mode 100644 index 00000000000..03dcc233810 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-nsm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-nsm.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-nsm.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/serviceaccount.yaml new file mode 100644 index 00000000000..33fea1fa38d --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-nsm.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "meshery-nsm.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..7bab9f4802a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-nsm.fullname" . }}-test-connection" + labels: +{{ include "meshery-nsm.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-nsm.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/values.yaml new file mode 100644 index 00000000000..ae5580cd5cb --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-nsm/values.yaml @@ -0,0 +1,88 @@ +# Default values for meshery-nsm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-nsm:stable-latest + pullPolicy: Always + +ports: + http: 10004 + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10004 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/Chart.yaml new file mode 100644 index 00000000000..13f60789e76 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: meshery-osm +description: Meshery Adapter for Open Service Mesh +source: + - https://github.com/layer5io/meshery-osm + +deprecated: false +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/README.md new file mode 100644 index 00000000000..371c3db7577 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/README.md @@ -0,0 +1,47 @@ +# meshery-osm + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Open Service Mesh + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-osm:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"meshery-osm.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| ports.http | int | `10009` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10009` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/NOTES.txt new file mode 100644 index 00000000000..1b72773a75e --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-osm.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-osm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-osm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-osm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:{{ .Values.ports.http }} + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/_helpers.tpl new file mode 100644 index 00000000000..8f92e2d8c25 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-osm.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 "meshery-osm.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 "meshery-osm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-osm.labels" -}} +helm.sh/chart: {{ include "meshery-osm.chart" . }} +{{ include "meshery-osm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-osm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-osm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-osm.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-osm.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/deployment.yaml new file mode 100644 index 00000000000..a8f3cd30e43 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-osm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-osm.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-osm.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-osm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-osm.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.ports.http }} + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/ingress.yaml new file mode 100644 index 00000000000..47bfc012946 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-osm.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-osm.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/service.yaml new file mode 100644 index 00000000000..f401eb11d50 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-osm.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-osm.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-osm.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/serviceaccount.yaml new file mode 100644 index 00000000000..eab242ca605 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-osm.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "meshery-osm.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..3c755ed0aac --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-osm.fullname" . }}-test-connection" + labels: +{{ include "meshery-osm.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-osm.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-osm/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/values.yaml new file mode 100644 index 00000000000..8c7a92d3f35 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-osm/values.yaml @@ -0,0 +1,88 @@ +# Default values for meshery-osm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-osm:stable-latest + pullPolicy: Always + +ports: + http: 10009 + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10009 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: meshery-osm.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/Chart.yaml new file mode 100644 index 00000000000..3103ffaad19 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: meshery-traefik-mesh +description: Meshery Adapter for Traefik Mesh chart. +source: + - https://github.com/layer5io/meshery-traefik-mesh + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need the confirm the image tag. +appVersion: stable-latest + +maintainers: + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: leecalcote@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/README.md new file mode 100644 index 00000000000..a06358c2444 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/README.md @@ -0,0 +1,45 @@ +# meshery-traefik-mesh + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: stable-latest](https://img.shields.io/badge/AppVersion-stable--latest-informational?style=flat-square) + +Meshery Adapter for Traefik Mesh chart. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| aisuko | urakiny@gmail.com | | +| leecalcote | leecalcote@gmail.com | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery-traefik-mesh:stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | string | `nil` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | kubernetes.io/tls-acme: "true" | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `10006` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.create | bool | `false` | | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceAccountNameOverride | string | `""` | | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/NOTES.txt new file mode 100644 index 00000000000..99056887b6c --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-traefik-mesh.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-traefik-mesh.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-traefik-mesh.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-traefik-mesh.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10000 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/_helpers.tpl new file mode 100644 index 00000000000..d1ec69f1bf3 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/_helpers.tpl @@ -0,0 +1,67 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-traefik-mesh.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 "meshery-traefik-mesh.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 "meshery-traefik-mesh.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-traefik-mesh.labels" -}} +helm.sh/chart: {{ include "meshery-traefik-mesh.chart" . }} +{{ include "meshery-traefik-mesh.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-traefik-mesh.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-traefik-mesh.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-traefik-mesh.serviceAccountName" -}} +{{- if .Values.serviceAccountNameOverride -}} + {{- .Values.serviceAccountNameOverride -}} +{{- else -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-traefik-mesh.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/deployment.yaml new file mode 100644 index 00000000000..f1821374441 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-traefik-mesh.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-traefik-mesh.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-traefik-mesh.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-traefik-mesh.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-traefik-mesh.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-traefik-mesh image version + image: "{{ .Values.image.repository }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 10000 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/ingress.yaml new file mode 100644 index 00000000000..3df9afe444a --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-traefik-mesh.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-traefik-mesh.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/service.yaml new file mode 100644 index 00000000000..b264a8caa53 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-traefik-mesh.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-traefik-mesh.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-traefik-mesh.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/serviceaccount.yaml new file mode 100644 index 00000000000..dc37da15c69 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.serviceAccountNameOverride) .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-traefik-mesh.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-traefik-mesh.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..71772aacd77 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-traefik-mesh.fullname" . }}-test-connection" + labels: +{{ include "meshery-traefik-mesh.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-traefik-mesh.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/values.yaml new file mode 100644 index 00000000000..7a81cbfbc86 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery-traefik-mesh/values.yaml @@ -0,0 +1,85 @@ +# Default values for meshery-traefik-mesh. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: layer5/meshery-traefik-mesh:stable-latest + pullPolicy: Always + +env: {} + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +# By default, this is provided by the top-level chart as "meshery-consul" +fullnameOverride: "" +# By default, this is provided by the top-level chart as "meshery-server" +serviceAccountNameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10006 + annotations: {} + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/.helmignore b/install/kubernetes/helm/meshery-operator/charts/meshery/.helmignore new file mode 100644 index 00000000000..50af0317254 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/.helmignore @@ -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/ diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/Chart.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/Chart.yaml new file mode 100644 index 00000000000..4c95f5365ce --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/Chart.yaml @@ -0,0 +1,57 @@ +apiVersion: v2 +name: meshery +description: Meshery chart for deploying Meshery and Meshery's adapters. +icon: https://meshery.io/images/logos/meshery-logo.png +kubeVersion: +keywords: + - meshery + - meshery-istio + - meshery-linkerd + - meshery-consul + - meshery-kuma + - meshery-osm + - meshery-nsm + - meshery-traefik-mesh + - meshery-cpx + - meshery-nginx-sm + - meshery-app-mesh + - meshery-operator + - meshery-broker + - meshery-meshsync +source: + - https://github.com/layer5io/meshery + +engine: gotpl + +deprecated: false + +# 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. +version: 2.1.2 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +# TODO: Need to confirm the image version +appVersion: v0.6.0 + + + +maintainers: + - name: Layer5 Authors + email: community@layer5.io + - name: aisuko + email: urakiny@gmail.com + - name: leecalcote + email: lee.calcote@layer5.io + - name: darrenlau + email: panyuenlau@gmail.com \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/README.md b/install/kubernetes/helm/meshery-operator/charts/meshery/README.md new file mode 100644 index 00000000000..7024aae32bd --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/README.md @@ -0,0 +1,54 @@ +# meshery + +![Version: 2.1.2](https://img.shields.io/badge/Version-2.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.6.0](https://img.shields.io/badge/AppVersion-v0.6.0-informational?style=flat-square) + +Meshery chart for deploying Meshery and Meshery's adapters. + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Layer5 Authors | community@layer5.io | | +| aisuko | urakiny@gmail.com | | +| leecalcote | lee.calcote@layer5.io | | +| darrenlau | panyuenlau@gmail.com | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| annotations | object | `{}` | | +| env.ADAPTER_URLS | string | `"meshery-istio:10000 meshery-linkerd:10001 meshery-consul:10002 meshery-kuma:10007 meshery-osm:10009 meshery-nginx-sm:10010 meshery-nsm:10004 meshery-app-mesh:10005 meshery-traefik-mesh:10006 meshery-cpx:10008"` | | +| env.EVENT | string | `"mesheryLocal"` | | +| env.PROVIDER_BASE_URLS | string | `"https://meshery.layer5.io"` | | +| env.SAAS_BASE_URL | string | `"https://meshery.layer5.io"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"layer5/meshery"` | | +| image.tag | string | `"stable-latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths | list | `[]` | | +| ingress.tls | list | `[]` | | +| mesherygateway | object | `{"enabled":false,"selector":{"istio":"ingressgateway"}}` | There will be an issue when deploying Meshery before Istio and this could make the deploying fail. meshery-gateway | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podSecurityContext | object | `{}` | | +| probe.livenessProbe.enabled | bool | `false` | | +| probe.readinessProbe.enabled | bool | `false` | | +| rbac.nodes | bool | `false` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| restartPolicy | string | `"Always"` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | | +| service.port | int | `9081` | | +| service.target_port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.name | string | `"meshery-server"` | If not set and create is true, a name is generated using the fullname template | +| testCase.enabled | bool | `false` | | +| tolerations | list | `[]` | | + diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/NOTES.txt new file mode 100644 index 00000000000..64f95b60840 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT/provider +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }}/provider +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:9081 + echo "Visit http://127.0.0.1:9081/provider to use your application" +{{- end }} +2. All the Notes.txt of Meshery, Mesheryistio and Mesherylinkerd need to add the content here. This can be achieved by sub PR. diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/_helpers.tpl new file mode 100644 index 00000000000..ad99b77a374 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery.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 "meshery.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 "meshery.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery.labels" -}} +helm.sh/chart: {{ include "meshery.chart" . }} +{{ include "meshery.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrole.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrole.yaml new file mode 100644 index 00000000000..ce4b8a79fae --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrole.yaml @@ -0,0 +1,16 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "meshery.serviceAccountName" . }} + labels: +{{- include "meshery.labels" . | nindent 4 }} +rules: +- apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' +- nonResourceURLs: ["/metrics", "/health", "/ping"] + verbs: + - get \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrolebinding.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrolebinding.yaml new file mode 100644 index 00000000000..cf3dfef0440 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/clusterrolebinding.yaml @@ -0,0 +1,14 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "meshery.serviceAccountName" . }} + labels: +{{- include "meshery.labels" . | nindent 4 }} +roleRef: + kind: ClusterRole + name: {{ include "meshery.serviceAccountName" . }} + apiGroup: rbac.authorization.k8s.io +subjects: +- kind: ServiceAccount + name: {{ include "meshery.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/deployment.yaml new file mode 100644 index 00000000000..fa51b7e81e9 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery.name" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery.selectorLabels" . | nindent 8 }} + spec: + restartPolicy: {{ .Values.restartPolicy }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository}}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/gateway.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/gateway.yaml new file mode 100644 index 00000000000..db5fa08c9ef --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/gateway.yaml @@ -0,0 +1,16 @@ +{{- if .Values.mesherygateway.enabled -}} +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: meshery-gateway +spec: + selector: + {{- toYaml .Values.mesherygateway.selector| nindent 4 }} + servers: + - port: + number: 80 + name: http + protocol: HTTP + hosts: + - "*" +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/ingress.yaml new file mode 100644 index 00000000000..cf5b2873c53 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery.name" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/service.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/service.yaml new file mode 100644 index 00000000000..66216fc6617 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery.name" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.target_port }} + protocol: TCP + name: http + selector: + {{- include "meshery.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/serviceaccount.yaml new file mode 100644 index 00000000000..6ee076952db --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/serviceaccount.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery.labels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..22956d81dbb --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery.fullname" . }}-test-connection" + labels: +{{ include "meshery.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/templates/virtualservice.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/virtualservice.yaml new file mode 100644 index 00000000000..442ca5efef8 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/templates/virtualservice.yaml @@ -0,0 +1,20 @@ +{{- if .Values.mesherygateway.enabled -}} +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: meshery +spec: + hosts: + - "*" + gateways: + - meshery-gateway + http: + - match: + - uri: + prefix: / + route: + - destination: + host: meshery + port: + number: 9081 +{{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/charts/meshery/values.yaml b/install/kubernetes/helm/meshery-operator/charts/meshery/values.yaml new file mode 100644 index 00000000000..8a812afb3fc --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/charts/meshery/values.yaml @@ -0,0 +1,104 @@ +# Default values for meshery. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 +restartPolicy: Always + +image: + repository: layer5/meshery + tag: stable-latest + pullPolicy: Always + +env: + EVENT: mesheryLocal + SAAS_BASE_URL: https://meshery.layer5.io + PROVIDER_BASE_URLS: https://meshery.layer5.io + ADAPTER_URLS: meshery-istio:10000 meshery-linkerd:10001 meshery-consul:10002 meshery-kuma:10007 meshery-osm:10009 meshery-nginx-sm:10010 meshery-nsm:10004 meshery-app-mesh:10005 meshery-traefik-mesh:10006 meshery-cpx:10008 + +probe: + #TODO: Need to confirm the health check path of meshery. + livenessProbe: + enabled: false + readinessProbe: + enabled: false + + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +# For AKS AWS GCP to get the permissions to watch the nodes +rbac: + nodes: false + +serviceAccount: + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "meshery-server" + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 9081 + target_port: 8080 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + + +# If there need the test cases set it as true. +# +testCase: + enabled: false + +# # TODO: There need to confirm that we should deploy the Gateway and VirtualService for Meshery or not. +# There will be an issue when deploying Meshery before Istio and this could make the deploying fail. +# meshery-gateway +# +mesherygateway: + enabled: false + selector: + istio: ingressgateway diff --git a/install/kubernetes/helm/meshery-operator/crds/crds.yaml b/install/kubernetes/helm/meshery-operator/crds/crds.yaml new file mode 100644 index 00000000000..699d96c2f0b --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/crds/crds.yaml @@ -0,0 +1,192 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.1 + creationTimestamp: null + name: brokers.meshery.layer5.io +spec: + group: meshery.layer5.io + names: + kind: Broker + listKind: BrokerList + plural: brokers + singular: broker + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Broker is the Schema for the brokers API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BrokerSpec defines the desired state of Broker + properties: + size: + format: int32 + type: integer + type: object + status: + description: BrokerStatus defines the observed state of Broker + properties: + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + reason: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + endpoint: + properties: + external: + type: string + internal: + type: string + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.1 + creationTimestamp: null + name: meshsyncs.meshery.layer5.io +spec: + group: meshery.layer5.io + names: + kind: MeshSync + listKind: MeshSyncList + plural: meshsyncs + singular: meshsync + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: MeshSync is the Schema for the meshsyncs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MeshSyncSpec defines the desired state of MeshSync + properties: + broker: + properties: + custom: + properties: + url: + type: string + type: object + native: + properties: + name: + type: string + namespace: + type: string + type: object + type: object + size: + format: int32 + type: integer + type: object + status: + description: MeshSyncStatus defines the observed state of MeshSync + properties: + conditions: + items: + properties: + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + reason: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + publishing-to: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/install/kubernetes/helm/meshery-operator/templates/NOTES.txt b/install/kubernetes/helm/meshery-operator/templates/NOTES.txt new file mode 100644 index 00000000000..0aac36db9a0 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "meshery-operator.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo $NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "meshery-operator.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "meshery-operator.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo $SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "meshery-operator.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9081:10000 + echo "Visit 127.0.0.1:9081 to use your application" +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/templates/_helpers.tpl b/install/kubernetes/helm/meshery-operator/templates/_helpers.tpl new file mode 100644 index 00000000000..c88866c049d --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "meshery-operator.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 "meshery-operator.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 "meshery-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "meshery-operator.labels" -}} +helm.sh/chart: {{ include "meshery-operator.chart" . }} +{{ include "meshery-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "meshery-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "meshery-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "meshery-operator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "meshery-operator.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/templates/clusterrole.yaml b/install/kubernetes/helm/meshery-operator/templates/clusterrole.yaml new file mode 100644 index 00000000000..80949aa6e21 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/clusterrole.yaml @@ -0,0 +1,116 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: meshery-metrics-reader + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +rules: +- nonResourceURLs: + - /metrics + verbs: + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: meshery-operator-role + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +rules: +- apiGroups: + - meshery.layer5.io + resources: + - brokers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - meshery.layer5.io + resources: + - brokers/status + verbs: + - get + - patch + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: meshery-proxy-role + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +rules: +- apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: meshery-leader-election-role + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - configmaps/status + verbs: + - get + - update + - patch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: meshery-controller-role + labels: + {{- include "meshery-operator.labels" . | nindent 4 }} +rules: +- apiGroups: + - '*' + resources: + - '*' + verbs: + - create + - delete + - get + - list + - patch + - update + - watch diff --git a/install/kubernetes/helm/meshery-operator/templates/clusterrolebinding.yaml b/install/kubernetes/helm/meshery-operator/templates/clusterrolebinding.yaml new file mode 100644 index 00000000000..c7bf7a6197f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/clusterrolebinding.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: meshery-leader-election-rolebinding + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: meshery-leader-election-role +subjects: +- kind: ServiceAccount + name: meshery-operator + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: meshery-operator-rolebinding + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: meshery-operator-role +subjects: +- kind: ServiceAccount + name: meshery-operator + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: meshery-proxy-rolebinding + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: meshery-proxy-role +subjects: +- kind: ServiceAccount + name: meshery-operator + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: meshery-controller-rolebinding + labels: + {{- include "meshery-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: meshery-controller-role +subjects: + - kind: ServiceAccount + name: meshery-operator + namespace: {{ .Release.Namespace }} diff --git a/install/kubernetes/helm/meshery-operator/templates/deployment.yaml b/install/kubernetes/helm/meshery-operator/templates/deployment.yaml new file mode 100644 index 00000000000..959e276b807 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/deployment.yaml @@ -0,0 +1,85 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "meshery-operator.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-operator.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.annotations | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "meshery-operator.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "meshery-operator.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "meshery-operator.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Values.mesheryOperator.name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # TODO: Need to confirm the meshery-operator image version + image: "{{ .Values.mesheryOperator.image.repository }}" + imagePullPolicy: {{ .Values.mesheryOperator.image.pullPolicy }} + ports: + - containerPort: 9443 + # hostPort: 9443 + name: server + - containerPort: 8080 + # TODO it's not a good idea we take account to the 8080 port, is there we need communicate through the physical ports + # hostPort: 8080 + name: metrics + {{- if .Values.probe.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: http + {{- end }} + {{- if .Values.probe.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if .Values.env }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val }} + {{- end }} + {{- end }} + args: {{- toYaml .Values.mesheryOperator.args | nindent 12}} + resources: + {{- toYaml .Values.resources | nindent 12 }} + command: {{- toYaml .Values.mesheryOperator.command | nindent 12 }} + - name: {{ .Values.kubeRbac.name }} + image: {{ .Values.kubeRbac.image.repository }} + imagePullPolicy: {{ .Values.kubeRbac.image.pullPolicy }} + ports: + - name: https + containerPort: 8443 + args: {{- toYaml .Values.kubeRbac.args | nindent 12}} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/install/kubernetes/helm/meshery-operator/templates/ingress.yaml b/install/kubernetes/helm/meshery-operator/templates/ingress.yaml new file mode 100644 index 00000000000..6170cf10f0f --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "meshery-operator.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-operator.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- 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: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/install/kubernetes/helm/meshery-operator/templates/service.yaml b/install/kubernetes/helm/meshery-operator/templates/service.yaml new file mode 100644 index 00000000000..6d9614f5684 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "meshery-operator.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "meshery-operator.labels" . | nindent 4 }} + annotations: +{{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "meshery-operator.selectorLabels" . | nindent 4 }} diff --git a/install/kubernetes/helm/meshery-operator/templates/serviceaccount.yaml b/install/kubernetes/helm/meshery-operator/templates/serviceaccount.yaml new file mode 100644 index 00000000000..a83ef81b5da --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "meshery-operator.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{- include "meshery-operator.labels" . | nindent 4 }} +{{- end -}} diff --git a/install/kubernetes/helm/meshery-operator/templates/tests/test-connection.yaml b/install/kubernetes/helm/meshery-operator/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..c1d97e029c1 --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testCase.enabled -}} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "meshery-operator.fullname" . }}-test-connection" + labels: +{{ include "meshery-operator.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "meshery-operator.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never +{{- end -}} \ No newline at end of file diff --git a/install/kubernetes/helm/meshery-operator/values.yaml b/install/kubernetes/helm/meshery-operator/values.yaml new file mode 100644 index 00000000000..b626a7cc04b --- /dev/null +++ b/install/kubernetes/helm/meshery-operator/values.yaml @@ -0,0 +1,176 @@ +# Default values for meshery-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +mesheryOperator: + name: manager + image: + repository: layer5/meshery-operator:stable-latest + pullPolicy: IfNotPresent + args: + - --metrics-addr=127.0.0.1:8080 + - --enable-leader-election + command: + - /manager + +kubeRbac: + name: kube-rbac-proxy + image: + repository: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0 + pullPolicy: IfNotPresent + args: + - --secure-listen-address=0.0.0.0:8443 + - --upstream=http://127.0.0.1:8080/ + - --logtostderr=false + - --v=10 + +env: {} + +probe: + livenessProbe: + enabled: false + readinessProbe: + enabled: false + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: create + # The name of the service account to use. + # If not set and create is false, a name is generated using the fullname template + name: meshery-operator + +podSecurityContext: {} + # fsGroup: 2000 + +annotations: {} + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: false + # runAsNonRoot: false + # runAsUser: 1000 + +service: + type: ClusterIP + port: 10000 + annotations: {} + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "false" + + hosts: + - host: chart-example.local + paths: [] + 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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +testCase: + enabled: false + + +# By default, the adapters need to have the same cluster role as the meshery to have permissions for performing necessary operations + +# If need to use a different service accounts for the adapters, modify the serviceAccountNameOverride for the corresponding adapters here, +# or set the serviceAccountNameOverride to empty while setting the serviceAccount information in the sub-chart accordingly +meshery-app-mesh: + enabled: false + fullnameOverride: meshery-app-mesh + serviceAccountNameOverride: meshery-server + +meshery-istio: + enabled: true + fullnameOverride: meshery-istio + serviceAccountNameOverride: meshery-server + +meshery-linkerd: + enabled: true + fullnameOverride: meshery-linkerd + serviceAccountNameOverride: meshery-server + +meshery-consul: + enabled: true + fullnameOverride: meshery-consul + serviceAccountNameOverride: meshery-server + +meshery-kuma: + enabled: true + fullnameOverride: meshery-kuma + serviceAccountNameOverride: meshery-server + +meshery-osm: + enabled: true + fullnameOverride: meshery-osm + serviceAccountNameOverride: meshery-server + +meshery-nsm: + enabled: false + fullnameOverride: meshery-nsm + serviceAccountNameOverride: meshery-server + +meshery-nginx-sm: + enabled: false + fullnameOverride: meshery-nginx-sm + serviceAccountNameOverride: meshery-server + +meshery-traefik-mesh: + enabled: false + fullnameOverride: meshery-traefik-mesh + serviceAccountNameOverride: meshery-server + +meshery-cpx: + enabled: false + fullnameOverride: meshery-cpx + serviceAccountNameOverride: meshery-server + +meshery: + enabled: true + fullnameOverride: meshery-server + serviceAccountNameOverride: meshery-server + +meshery-broker: + enabled: true + fullnameOverride: meshery-broker + serviceAccountNameOverride: meshery-server + +meshery-meshsync: + enabled: true + fullnameOverride: meshery-meshsync + serviceAccountNameOverride: meshery-server + + +# The operator has its own cluster role +# meshery-operator: +# enabled: true +# fullnameOverride: meshery-operator \ No newline at end of file