diff --git a/kubernetes/charts/.helmignore b/charts/.helmignore similarity index 100% rename from kubernetes/charts/.helmignore rename to charts/.helmignore diff --git a/kubernetes/charts/Chart.lock b/charts/Chart.lock similarity index 100% rename from kubernetes/charts/Chart.lock rename to charts/Chart.lock diff --git a/kubernetes/charts/Chart.yaml b/charts/Chart.yaml similarity index 89% rename from kubernetes/charts/Chart.yaml rename to charts/Chart.yaml index 3ef70636..94bc1401 100644 --- a/kubernetes/charts/Chart.yaml +++ b/charts/Chart.yaml @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ apiVersion: v2 -name: Chart to install MPS, RPS and Backend db -description: A Helm chart for Kubernetes +name: console +description: Helm chart for Device Management Toolkit (Console) — cloud or on-prem # A chart can be either an 'application' or a 'library' chart. # @@ -22,7 +22,7 @@ version: 1.0.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. -appVersion: 1.4.0 +appVersion: 1.24.3 dependencies: - name: vault @@ -32,3 +32,4 @@ dependencies: - name: kong version: "^3.0.2" repository: https://charts.konghq.com + condition: kong.enabled diff --git a/kubernetes/charts/charts/kong-3.0.2.tgz b/charts/charts/kong-3.0.2.tgz similarity index 100% rename from kubernetes/charts/charts/kong-3.0.2.tgz rename to charts/charts/kong-3.0.2.tgz diff --git a/kubernetes/charts/charts/vault-0.32.0.tgz b/charts/charts/vault-0.32.0.tgz similarity index 100% rename from kubernetes/charts/charts/vault-0.32.0.tgz rename to charts/charts/vault-0.32.0.tgz diff --git a/kubernetes/charts/secrets.yaml b/charts/secrets.yaml similarity index 100% rename from kubernetes/charts/secrets.yaml rename to charts/secrets.yaml diff --git a/kubernetes/charts/templates/_helpers.tpl b/charts/templates/_helpers.tpl similarity index 100% rename from kubernetes/charts/templates/_helpers.tpl rename to charts/templates/_helpers.tpl diff --git a/kubernetes/charts/templates/mps.yaml b/charts/templates/console.yaml similarity index 61% rename from kubernetes/charts/templates/mps.yaml rename to charts/templates/console.yaml index bdff146c..53b12155 100644 --- a/kubernetes/charts/templates/mps.yaml +++ b/charts/templates/console.yaml @@ -2,12 +2,13 @@ # Copyright (c) Intel Corporation 2020 # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ +{{- if .Values.console.enabled }} apiVersion: v1 kind: Service metadata: labels: - app: mps - name: mps + app: console + name: console spec: ports: - port: 4433 @@ -19,28 +20,28 @@ spec: protocol: TCP targetPort: 3000 selector: - app: mps + app: console --- apiVersion: apps/v1 kind: Deployment metadata: - name: mps + name: console namespace: default spec: - replicas: {{ .Values.mps.replicaCount }} + replicas: {{ .Values.console.replicaCount }} selector: matchLabels: - app: mps + app: console template: metadata: labels: - app: mps + app: console spec: imagePullSecrets: - name: registrycredentials containers: - - name: mps - image: {{ .Values.images.mps }} + - name: console + image: {{ .Values.images.console }} readinessProbe: httpGet: path: /api/v1/health @@ -49,54 +50,55 @@ spec: timeoutSeconds: 12 failureThreshold: 3 env: - - name: "MPS_LOG_LEVEL" - value: "{{ .Values.mps.logLevel }}" - - name: "MPS_COMMON_NAME" - value: "{{ .Values.mps.commonName }}" - - name: "MPS_CONNECTION_STRING" + - name: "CONSOLE_HEADLESS" + value: "{{ .Values.console.headless }}" + - name: "CONSOLE_LOG_LEVEL" + value: "{{ .Values.console.logLevel }}" + - name: "CONSOLE_COMMON_NAME" + value: "{{ .Values.console.commonName }}" + - name: "CONSOLE_CONNECTION_STRING" valueFrom: secretKeyRef: - name: mps + name: console key: connectionString - - name: "MPS_VAULT_ADDRESS" + - name: "CONSOLE_VAULT_ADDRESS" value: "http://{{ .Release.Name }}-vault:8200" - - name: "MPS_SECRETS_PATH" + - name: "CONSOLE_SECRETS_PATH" value: 'kv/data/' - - name: "MPS_PORT" + - name: "CONSOLE_PORT" value: '4433' - - name: "MPS_INSTANCE_NAME" + - name: "CONSOLE_INSTANCE_NAME" valueFrom: fieldRef: fieldPath: status.podIP - - name: "MPS_JWT_EXPIRATION" - value: "{{ .Values.mps.jwtExpiration }}" - - name: "MPS_JWT_SECRET" + - name: "CONSOLE_JWT_SECRET" valueFrom: secretKeyRef: name: device-mgmt-toolkit-admin-jwt key: secret - - name: "MPS_JWT_ISSUER" + - name: "CONSOLE_JWT_ISSUER" valueFrom: secretKeyRef: name: device-mgmt-toolkit-admin-jwt key: key - - name: MPS_WEB_ADMIN_USER + - name: CONSOLE_WEB_ADMIN_USER valueFrom: secretKeyRef: - name: mpsweb + name: consoleweb key: user - - name: MPS_WEB_ADMIN_PASSWORD + - name: CONSOLE_WEB_ADMIN_PASSWORD valueFrom: secretKeyRef: - name: mpsweb + name: consoleweb key: password - - name: MPS_VAULT_TOKEN + - name: CONSOLE_VAULT_TOKEN valueFrom: secretKeyRef: name: vault key: vaultKey ports: - containerPort: 3000 - name: mps + name: webapi - containerPort: 4433 - name: mpsws + name: cira +{{- end }} diff --git a/kubernetes/charts/templates/kong.yaml b/charts/templates/kong.yaml similarity index 97% rename from kubernetes/charts/templates/kong.yaml rename to charts/templates/kong.yaml index 61fb48ef..84900574 100644 --- a/kubernetes/charts/templates/kong.yaml +++ b/charts/templates/kong.yaml @@ -1,3 +1,4 @@ +{{- if .Values.kong.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -57,8 +58,8 @@ spec: pathType: Exact backend: service: - name: mps - port: + name: console + port: number: 3000 --- apiVersion: configuration.konghq.com/v1 @@ -152,7 +153,7 @@ spec: rules: - port: 4433 backend: - serviceName: mps + serviceName: console servicePort: 4433 --- apiVersion: configuration.konghq.com/v1 @@ -188,3 +189,4 @@ metadata: plugin: acl config: allow: ["device-mgmt-toolkit-admin"] +{{- end }} diff --git a/kubernetes/charts/templates/mpsrouter.yaml b/charts/templates/mpsrouter.yaml similarity index 97% rename from kubernetes/charts/templates/mpsrouter.yaml rename to charts/templates/mpsrouter.yaml index cb9b4f72..a8ce5a5b 100644 --- a/kubernetes/charts/templates/mpsrouter.yaml +++ b/charts/templates/mpsrouter.yaml @@ -2,6 +2,7 @@ # Copyright (c) Intel Corporation 2020 # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ +{{- if .Values.mpsrouter.enabled }} apiVersion: v1 kind: Service metadata: @@ -61,4 +62,4 @@ spec: ports: - containerPort: 8003 name: mpsrouter - +{{- end }} diff --git a/kubernetes/charts/templates/rps.yaml b/charts/templates/rps.yaml similarity index 97% rename from kubernetes/charts/templates/rps.yaml rename to charts/templates/rps.yaml index 82deaa5a..44e951e7 100644 --- a/kubernetes/charts/templates/rps.yaml +++ b/charts/templates/rps.yaml @@ -2,6 +2,7 @@ # Copyright (c) Intel Corporation 2020 # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ +{{- if .Values.rps.enabled }} apiVersion: v1 kind: Service metadata: @@ -75,3 +76,4 @@ spec: name: rps - containerPort: 8081 name: rpsweb +{{- end }} diff --git a/kubernetes/charts/templates/webui.yaml b/charts/templates/webui.yaml similarity index 88% rename from kubernetes/charts/templates/webui.yaml rename to charts/templates/webui.yaml index ef1f8660..f4b8b8b1 100644 --- a/kubernetes/charts/templates/webui.yaml +++ b/charts/templates/webui.yaml @@ -2,6 +2,7 @@ # Copyright (c) Intel Corporation 2020 # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ +{{- if .Values.webui.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -50,7 +51,7 @@ kind: Deployment metadata: name: webui spec: - replicas: {{ .Values.ui.replicaCount }} + replicas: {{ .Values.webui.replicaCount }} selector: matchLabels: app: webui @@ -77,9 +78,10 @@ spec: subPath: nginx.conf env: - name: "MPS_SERVER" - value: "https://{{.Values.mps.commonName}}/mps" + value: "https://{{.Values.console.commonName}}/mps" - name: "RPS_SERVER" - value: "https://{{.Values.mps.commonName}}/rps" + value: "https://{{.Values.console.commonName}}/rps" ports: - containerPort: 80 - name: ui \ No newline at end of file + name: ui +{{- end }} \ No newline at end of file diff --git a/charts/values-cloud.yaml b/charts/values-cloud.yaml new file mode 100644 index 00000000..191895cc --- /dev/null +++ b/charts/values-cloud.yaml @@ -0,0 +1,22 @@ +#/********************************************************************* +# Copyright (c) Intel Corporation 2020 +# SPDX-License-Identifier: Apache-2.0 +#**********************************************************************/ +# Cloud overlay: headless Console + sample-web-ui + kong + mps-router. +# Use: helm install console ./charts -f ./charts/values-cloud.yaml + +console: + headless: true + +webui: + enabled: true + +mpsrouter: + enabled: true + +kong: + enabled: true + +vault: + ui: + serviceType: "LoadBalancer" diff --git a/charts/values-onprem.yaml b/charts/values-onprem.yaml new file mode 100644 index 00000000..072690f2 --- /dev/null +++ b/charts/values-onprem.yaml @@ -0,0 +1,18 @@ +#/********************************************************************* +# Copyright (c) Intel Corporation 2020 +# SPDX-License-Identifier: Apache-2.0 +#**********************************************************************/ +# On-prem overlay: Console with built-in UI; no sample-web-ui, no kong, no mps-router. +# Use: helm install console ./charts -f ./charts/values-onprem.yaml + +console: + headless: false + +webui: + enabled: false + +mpsrouter: + enabled: false + +kong: + enabled: false diff --git a/kubernetes/charts/values.yaml b/charts/values.yaml similarity index 68% rename from kubernetes/charts/values.yaml rename to charts/values.yaml index ee746216..7af6eb38 100644 --- a/kubernetes/charts/values.yaml +++ b/charts/values.yaml @@ -2,25 +2,35 @@ # Copyright (c) Intel Corporation 2020 # SPDX-License-Identifier: Apache-2.0 #**********************************************************************/ -# Default values for installServersChart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +# Base values for the Console chart. +# Override per-flavor with values-cloud.yaml or values-onprem.yaml. images: - mps: "intel/device-mgmt-toolkit-mps:latest" + console: "intel/device-mgmt-toolkit-console:latest" rps: "intel/device-mgmt-toolkit-rps:latest" webui: "intel/device-mgmt-toolkit-web-ui:latest" mpsrouter: "intel/device-mgmt-toolkit-mps-router:latest" -mps: - commonName: - replicaCount: 1 - logLevel: "silly" - jwtExpiration: 1440 -ui: + +console: + enabled: true + headless: false + commonName: replicaCount: 1 + logLevel: "info" + rps: + enabled: true + replicaCount: 1 + logLevel: "info" + +webui: + enabled: false + replicaCount: 1 + +mpsrouter: + enabled: false replicaCount: 1 - logLevel: "silly" + vault: injector: annotations: @@ -32,11 +42,13 @@ vault: annotations: kuma.io/sidecar-injection: disabled enabled: true - serviceType: "LoadBalancer" -kong: + serviceType: "ClusterIP" + +kong: + enabled: false podAnnotations: - kuma.io/sidecar-injection: enabled - kuma.io/gateway: enabled + kuma.io/sidecar-injection: enabled + kuma.io/gateway: enabled env: UPSTREAM_KEEPALIVE_POOL_SIZE: 0 proxy: @@ -48,5 +60,3 @@ kong: parameters: [] http: enabled: false -mpsrouter: - replicaCount: 1 diff --git a/kubernetes/config.json b/kubernetes/config.json deleted file mode 100644 index b322d446..00000000 --- a/kubernetes/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "auths": { - "https://index.docker.io/v1/": { - "auth": "" - } - }, - "HttpHeaders": { - "User-Agent": "Docker-Client/18.09.1 (windows)" - } -} \ No newline at end of file