From 7b2b462ca836fd6bd0366e332548dc8df07cf96c Mon Sep 17 00:00:00 2001 From: Adnan Abdulhussein Date: Thu, 16 Aug 2018 15:32:02 -0700 Subject: [PATCH] [bitnami/kubeapps] sync to 0.2.0 adds basic chart tests --- bitnami/kubeapps/Chart.yaml | 2 +- bitnami/kubeapps/README.md | 4 ++-- .../templates/tests/test-chartsvc.yaml | 20 +++++++++++++++++ .../templates/tests/test-dashboard.yaml | 18 +++++++++++++++ .../templates/tests/test-tiller-proxy.yaml | 22 +++++++++++++++++++ bitnami/kubeapps/values.yaml | 7 ++++++ 6 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 bitnami/kubeapps/templates/tests/test-chartsvc.yaml create mode 100644 bitnami/kubeapps/templates/tests/test-dashboard.yaml create mode 100644 bitnami/kubeapps/templates/tests/test-tiller-proxy.yaml diff --git a/bitnami/kubeapps/Chart.yaml b/bitnami/kubeapps/Chart.yaml index e7bb836cc..61068dce8 100644 --- a/bitnami/kubeapps/Chart.yaml +++ b/bitnami/kubeapps/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kubeapps -version: 0.1.2 +version: 0.2.0 appVersion: 1.0.0.alpha.5 description: Kubeapps is a dashboard for your Kubernetes cluster that makes it easy to deploy and manage applications in your cluster using Helm icon: https://raw.githubusercontent.com/kubeapps/kubeapps/master/docs/img/logo.png diff --git a/bitnami/kubeapps/README.md b/bitnami/kubeapps/README.md index 3c2771181..df0b4a68d 100644 --- a/bitnami/kubeapps/README.md +++ b/bitnami/kubeapps/README.md @@ -9,7 +9,7 @@ - Add custom and private chart repositories (supports [ChartMuseum](https://github.com/helm/chartmuseum) and [JFrog Artifactory](https://www.jfrog.com/confluence/display/RTF/Helm+Chart+Repositories)) - Browse and provision external services from the [Service Catalog](https://github.com/kubernetes-incubator/service-catalog) and available Service Brokers - Connect Helm-based applications to external services with Service Catalog Bindings -- Secure authentication and authorization based on Kubernetes [Role-Based Access Control](docs/user/access-control.md) +- Secure authentication and authorization based on Kubernetes [Role-Based Access Control](https://github.com/kubeapps/kubeapps/blob/master/docs/user/access-control.md) ## TL;DR; @@ -40,7 +40,7 @@ $ helm repo add bitnami https://charts.bitnami.com/bitnami $ helm install --name kubeapps --namespace kubeapps bitnami/kubeapps ``` -> **IMPORTANT** This assumes an insecure Helm installation, which is not recommended in production. See [the documentation to learn how to secure Helm and Kubeapps in production](securing-kubeapps.md). +> **IMPORTANT** This assumes an insecure Helm installation, which is not recommended in production. See [the documentation to learn how to secure Helm and Kubeapps in production](https://github.com/kubeapps/kubeapps/blob/master/docs/user/securing-kubeapps.md). The command deploys Kubeapps on the Kubernetes cluster in the `kubeapps` namespace. The [configuration](#configuration) section lists the parameters that can be configured during installation. diff --git a/bitnami/kubeapps/templates/tests/test-chartsvc.yaml b/bitnami/kubeapps/templates/tests/test-chartsvc.yaml new file mode 100644 index 000000000..12f7c2d7d --- /dev/null +++ b/bitnami/kubeapps/templates/tests/test-chartsvc.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-chartsvc-test" + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: {{ .Release.Name }}-chartsvc-test + image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }} + env: + - name: CHARTSVC_HOST + value: {{ template "kubeapps.chartsvc.fullname" . }}.{{ .Release.Namespace }} + - name: CHARTSVC_PORT + value: "{{ .Values.chartsvc.service.port }}" + command: + - sh + - -c + - curl $CHARTSVC_HOST:$CHARTSVC_PORT/v1/charts | grep wordpress + restartPolicy: Never diff --git a/bitnami/kubeapps/templates/tests/test-dashboard.yaml b/bitnami/kubeapps/templates/tests/test-dashboard.yaml new file mode 100644 index 000000000..a26d35e87 --- /dev/null +++ b/bitnami/kubeapps/templates/tests/test-dashboard.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-dashboard-test" + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: {{ .Release.Name }}-dashboard-test + image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }} + env: + - name: DASHBOARD_HOST + value: {{ template "kubeapps.fullname" . }}.{{ .Release.Namespace }} + command: + - sh + - -c + - curl $DASHBOARD_HOST | grep 'You need to enable JavaScript to run this app' + restartPolicy: Never diff --git a/bitnami/kubeapps/templates/tests/test-tiller-proxy.yaml b/bitnami/kubeapps/templates/tests/test-tiller-proxy.yaml new file mode 100644 index 000000000..0a7aecfde --- /dev/null +++ b/bitnami/kubeapps/templates/tests/test-tiller-proxy.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-tiller-proxy-test" + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: {{ .Release.Name }}-tiller-proxy-test + image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }} + env: + - name: TILLER_PROXY_HOST + value: {{ template "kubeapps.tiller-proxy.fullname" . }}.{{ .Release.Namespace }} + - name: TILLER_PROXY_PORT + value: "{{ .Values.tillerProxy.service.port }}" + - name: KUBEAPPS_RELEASE + value: {{ .Release.Name }} + command: + - sh + - -c + - "curl -ik -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" $TILLER_PROXY_HOST:$TILLER_PROXY_PORT/v1/releases | grep $KUBEAPPS_RELEASE" + restartPolicy: Never diff --git a/bitnami/kubeapps/values.yaml b/bitnami/kubeapps/values.yaml index 064bcdc79..ba22dae05 100644 --- a/bitnami/kubeapps/values.yaml +++ b/bitnami/kubeapps/values.yaml @@ -177,3 +177,10 @@ affinity: {} rbac: # Perform creation of RBAC resources create: true + +testImage: + # Image used for the tests. The only requirement is to include curl + registry: docker.io + repository: bitnami/nginx + tag: 1.14.0-r27 +