From a57d8dd090a3d3d747ba40ef58e14215e88adfa2 Mon Sep 17 00:00:00 2001 From: Mandeep Khinda Date: Fri, 9 Mar 2018 14:29:37 +0000 Subject: iterating on new helm structure for SO with this change we can now do the following: can deploy umbrella chart with currently working components: helm install local/onap --name onap --namespace onap-all helm install local/onap --name onap-2 --namespace onap-all-2 \ --set global.nodePortPrefix=303 - umbrella includes setup chart can deploy a-la-carte component by component into a single namespace - Need to deploy a setup chart first. cannot be made a helm dependency as there will be conflicts if each app chart has the same setup dependency. helm install local/setup --name onap-setup --namespace onap-apps helm install local/so --name so1 --namespace onap-apps \ --set global.nodePortPrefix=304 helm list NAME REVISION STATUS CHART NAMESPACE onap 1 DEPLOYED onap-2.0.0 onap-all onap-2 1 DEPLOYED onap-2.0.0 onap-all-2 onap-setup 1 DEPLOYED setup-2.0.0 onap-apps so1 1 DEPLOYED so-2.0.0 onap-apps Unfortunately, the config maps all have fixed names, so installing the same app in the a-la-carte fashion will fail due to a collision. Not worrying about this as I'm not sure we want to support this. -made the common and setup charts standalone to remove relative file paths from requirements.yaml This will help when there are different levels of subcharts that need to include common Issue-ID: OOM-786 Issue-ID: OOM-789 Issue-ID: OOM-788 Change-Id: I20bacae6f0f20e8f3bb1527af1e7e53f187341d5 Signed-off-by: Mandeep Khinda --- kubernetes/Makefile | 16 ++++++++--- kubernetes/common/.helmignore | 21 +++++++++++++++ kubernetes/common/Chart.yaml | 4 +++ kubernetes/common/Makefile | 25 ----------------- kubernetes/common/common-templates/.helmignore | 21 --------------- kubernetes/common/common-templates/Chart.yaml | 4 --- .../common/common-templates/templates/_name.tpl | 15 ----------- .../common-templates/templates/_namespace.tpl | 11 -------- kubernetes/common/common-templates/values.yaml | 31 ---------------------- kubernetes/common/templates/_name.tpl | 15 +++++++++++ kubernetes/common/templates/_namespace.tpl | 10 +++++++ kubernetes/common/values.yaml | 31 ++++++++++++++++++++++ kubernetes/onap/requirements.yaml | 6 +++++ kubernetes/onap/values.yaml | 1 + kubernetes/setup/.helmignore | 21 +++++++++++++++ kubernetes/setup/Chart.yaml | 4 +++ kubernetes/setup/requirements.yaml | 7 +++++ kubernetes/setup/templates/clusterrolebinding.yaml | 18 +++++++++++++ kubernetes/setup/templates/secrets.yaml | 13 +++++++++ kubernetes/setup/values.yaml | 4 +++ kubernetes/so/charts/mariadb/Chart.yaml | 2 +- kubernetes/so/charts/mariadb/templates/NOTES.txt | 8 +++--- .../mariadb/templates/clusterrolebinding.yaml | 19 ------------- .../so/charts/mariadb/templates/deployment.yaml | 8 +++--- kubernetes/so/charts/mariadb/templates/pv.yaml | 2 +- kubernetes/so/charts/mariadb/templates/pvc.yaml | 2 +- .../so/charts/mariadb/templates/secrets.yaml | 16 +---------- .../so/charts/mariadb/templates/service.yaml | 2 +- kubernetes/so/requirements.yaml | 4 +-- kubernetes/so/templates/NOTES.txt | 8 +++--- kubernetes/so/templates/clusterrolebinding.yaml | 19 ------------- kubernetes/so/templates/deployment.yaml | 6 ++--- kubernetes/so/templates/namespace.yaml | 4 --- kubernetes/so/templates/secrets.yaml | 13 --------- kubernetes/so/templates/service.yaml | 2 +- kubernetes/so/values.yaml | 2 ++ 36 files changed, 192 insertions(+), 203 deletions(-) create mode 100644 kubernetes/common/.helmignore create mode 100644 kubernetes/common/Chart.yaml delete mode 100644 kubernetes/common/Makefile delete mode 100644 kubernetes/common/common-templates/.helmignore delete mode 100644 kubernetes/common/common-templates/Chart.yaml delete mode 100644 kubernetes/common/common-templates/templates/_name.tpl delete mode 100644 kubernetes/common/common-templates/templates/_namespace.tpl delete mode 100644 kubernetes/common/common-templates/values.yaml create mode 100644 kubernetes/common/templates/_name.tpl create mode 100644 kubernetes/common/templates/_namespace.tpl create mode 100644 kubernetes/common/values.yaml create mode 100644 kubernetes/setup/.helmignore create mode 100644 kubernetes/setup/Chart.yaml create mode 100644 kubernetes/setup/requirements.yaml create mode 100644 kubernetes/setup/templates/clusterrolebinding.yaml create mode 100644 kubernetes/setup/templates/secrets.yaml create mode 100644 kubernetes/setup/values.yaml delete mode 100644 kubernetes/so/charts/mariadb/templates/clusterrolebinding.yaml delete mode 100644 kubernetes/so/templates/clusterrolebinding.yaml delete mode 100644 kubernetes/so/templates/namespace.yaml delete mode 100644 kubernetes/so/templates/secrets.yaml diff --git a/kubernetes/Makefile b/kubernetes/Makefile index 5e8350492c..4cf97059ac 100644 --- a/kubernetes/Makefile +++ b/kubernetes/Makefile @@ -1,18 +1,26 @@ PARENT_CHART := onap COMMON_CHARTS_DIR := common - +SETUP_CHARTS_DIR := setup # FIXME OOM-765 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) OUTPUT_DIR := $(ROOT_DIR)/dist PACKAGE_DIR := $(OUTPUT_DIR)/packages SECRET_DIR := $(OUTPUT_DIR)/secrets -EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae -HELM_CHARTS := $(COMMON_CHARTS_DIR) $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) +EXCLUDES := $(SETUP_CHARTS_DIR) $(COMMON_CHARTS_DIR) config oneclick readiness test dist $(PARENT_CHART) dcae +HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) .PHONY: $(EXCLUDES) $(HELM_CHARTS) -all: $(HELM_CHARTS) +all: $(COMMON_CHARTS_DIR) $(SETUP_CHARTS_DIR) $(HELM_CHARTS) + +common: + @echo "\n[$@]" + @make package-$@ + +setup: + @echo "\n[$@]" + @make package-$@ $(HELM_CHARTS): @echo "\n[$@]" diff --git a/kubernetes/common/.helmignore b/kubernetes/common/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/common/.helmignore @@ -0,0 +1,21 @@ +# 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 diff --git a/kubernetes/common/Chart.yaml b/kubernetes/common/Chart.yaml new file mode 100644 index 0000000000..aed57348e0 --- /dev/null +++ b/kubernetes/common/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: Common templates for inclusion in other charts +name: common +version: 2.0.0 diff --git a/kubernetes/common/Makefile b/kubernetes/common/Makefile deleted file mode 100644 index 1900f31a44..0000000000 --- a/kubernetes/common/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -EXCLUDES := test -HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) - -.PHONY: $(EXCLUDES) $(HELM_CHARTS) - -all: $(HELM_CHARTS) - -$(HELM_CHARTS): - @echo "\n[$@]" - @make lint-$@ - -make-%: - @if [ -f $*/Makefile ]; then make -C $*; fi - -dep-%: make-% - @if [ -f $*/requirements.yaml ]; then helm dep up $*; fi - -lint-%: dep-% - @if [ -f $*/Chart.yaml ]; then helm lint $*; fi - -clean: - @rm -f */requirements.lock - @rm -f *tgz */charts/*tgz -%: - @: \ No newline at end of file diff --git a/kubernetes/common/common-templates/.helmignore b/kubernetes/common/common-templates/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/kubernetes/common/common-templates/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# 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 diff --git a/kubernetes/common/common-templates/Chart.yaml b/kubernetes/common/common-templates/Chart.yaml deleted file mode 100644 index 01135755ba..0000000000 --- a/kubernetes/common/common-templates/Chart.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -description: Common templates for inclusion in other charts -name: common-templates -version: 2.0.0 diff --git a/kubernetes/common/common-templates/templates/_name.tpl b/kubernetes/common/common-templates/templates/_name.tpl deleted file mode 100644 index f6c221f15d..0000000000 --- a/kubernetes/common/common-templates/templates/_name.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{{/* - Expand the name of a chart. -*/}} -{{- define "common.name" -}} - {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* - Create a default fully qualified application name. - Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "common.fullname" -}} - {{- $name := default .Chart.Name .Values.nameOverride -}} - {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file diff --git a/kubernetes/common/common-templates/templates/_namespace.tpl b/kubernetes/common/common-templates/templates/_namespace.tpl deleted file mode 100644 index 2964a0f207..0000000000 --- a/kubernetes/common/common-templates/templates/_namespace.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* - Resolve the namespace to apply to a chart. The default namespace suffix - is the name of the chart. This can be overridden if necessary (eg. for subcharts) - using the following value: - - - .Values.nsPrefix : override namespace prefix - - .Values.nsSuffix : override namespace suffix -*/}} -{{- define "common.namespace" -}} - {{- default .Release.Name .Values.nsPrefix -}} -{{- end -}} diff --git a/kubernetes/common/common-templates/values.yaml b/kubernetes/common/common-templates/values.yaml deleted file mode 100644 index 112875753d..0000000000 --- a/kubernetes/common/common-templates/values.yaml +++ /dev/null @@ -1,31 +0,0 @@ -################################################################# -# Global configuration default values that can be inherited by -# all subcharts. -################################################################# -global: - # Change to an unused port prefix range to prevent port conflicts - # with other instances running within the same k8s cluster - nodePortPrefix: 302 - - # image repositories - repository: nexus3.onap.org:10001 - repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== - - # readiness check - readinessRepository: oomk8s - readinessImage: readiness-check:1.0.0 - - # logging agent - loggingRepository: docker.elastic.co - loggingImage: beats/filebeat:5.5.0 - - # image pull policy - pullPolicy: Always - - # default mount path root directory referenced - # by persistent volumes and log files - persistence: - mountPath: /dockerdata-nfs - - # flag to enable debugging - application support required - debugEnabled: true \ No newline at end of file diff --git a/kubernetes/common/templates/_name.tpl b/kubernetes/common/templates/_name.tpl new file mode 100644 index 0000000000..f6c221f15d --- /dev/null +++ b/kubernetes/common/templates/_name.tpl @@ -0,0 +1,15 @@ +{{/* + Expand the name of a chart. +*/}} +{{- define "common.name" -}} + {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* + Create a default fully qualified application name. + Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "common.fullname" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/common/templates/_namespace.tpl b/kubernetes/common/templates/_namespace.tpl new file mode 100644 index 0000000000..3da9fee7c1 --- /dev/null +++ b/kubernetes/common/templates/_namespace.tpl @@ -0,0 +1,10 @@ +{{/* + Resolve the namespace to apply to a chart. The default namespace suffix + is the name of the chart. This can be overridden if necessary (eg. for subcharts) + using the following value: + + - .Values.nsPrefix : override namespace prefix +*/}} +{{- define "common.namespace" -}} + {{- default .Release.Namespace .Values.nsPrefix -}} +{{- end -}} diff --git a/kubernetes/common/values.yaml b/kubernetes/common/values.yaml new file mode 100644 index 0000000000..112875753d --- /dev/null +++ b/kubernetes/common/values.yaml @@ -0,0 +1,31 @@ +################################################################# +# Global configuration default values that can be inherited by +# all subcharts. +################################################################# +global: + # Change to an unused port prefix range to prevent port conflicts + # with other instances running within the same k8s cluster + nodePortPrefix: 302 + + # image repositories + repository: nexus3.onap.org:10001 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + + # readiness check + readinessRepository: oomk8s + readinessImage: readiness-check:1.0.0 + + # logging agent + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + + # image pull policy + pullPolicy: Always + + # default mount path root directory referenced + # by persistent volumes and log files + persistence: + mountPath: /dockerdata-nfs + + # flag to enable debugging - application support required + debugEnabled: true \ No newline at end of file diff --git a/kubernetes/onap/requirements.yaml b/kubernetes/onap/requirements.yaml index 8f123128ad..4a3dc3a310 100644 --- a/kubernetes/onap/requirements.yaml +++ b/kubernetes/onap/requirements.yaml @@ -23,6 +23,9 @@ dependencies: version: ~0.1.0 repository: '@local' condition: cli.enabled + - name: common + version: ~2.0.0 + repository: '@local' - name: consul version: ~1.1.0 repository: '@local' @@ -79,6 +82,9 @@ dependencies: version: ~0.1.0 repository: '@local' condition: sdnc.enabled + - name: setup + version: ~2.0.0 + repository: '@local' - name: so version: ~2.0.0 repository: '@local' diff --git a/kubernetes/onap/values.yaml b/kubernetes/onap/values.yaml index 5340c95f57..a1d901ac0f 100644 --- a/kubernetes/onap/values.yaml +++ b/kubernetes/onap/values.yaml @@ -28,6 +28,7 @@ global: # flag to enable debugging - application support required debugEnabled: false + ################################################################# # Enable/disable and configure helm charts (ie. applications) # to customize the ONAP deployment. diff --git a/kubernetes/setup/.helmignore b/kubernetes/setup/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/setup/.helmignore @@ -0,0 +1,21 @@ +# 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 diff --git a/kubernetes/setup/Chart.yaml b/kubernetes/setup/Chart.yaml new file mode 100644 index 0000000000..cface1324c --- /dev/null +++ b/kubernetes/setup/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: An ONAP environment setup chart +name: setup +version: 2.0.0 diff --git a/kubernetes/setup/requirements.yaml b/kubernetes/setup/requirements.yaml new file mode 100644 index 0000000000..56029ab047 --- /dev/null +++ b/kubernetes/setup/requirements.yaml @@ -0,0 +1,7 @@ +dependencies: + - name: common + version: ~2.0.0 + # local reference to common chart, as it is + # a part of this chart's package and will not + # be published independently to a repo (at this point) + repository: '@local' \ No newline at end of file diff --git a/kubernetes/setup/templates/clusterrolebinding.yaml b/kubernetes/setup/templates/clusterrolebinding.yaml new file mode 100644 index 0000000000..b2bdc72549 --- /dev/null +++ b/kubernetes/setup/templates/clusterrolebinding.yaml @@ -0,0 +1,18 @@ +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: {{ include "common.namespace" . }}-binding + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: + - kind: ServiceAccount + name: default + namespace: {{ include "common.namespace" . }} \ No newline at end of file diff --git a/kubernetes/setup/templates/secrets.yaml b/kubernetes/setup/templates/secrets.yaml new file mode 100644 index 0000000000..573883a4a0 --- /dev/null +++ b/kubernetes/setup/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.namespace" . }}-docker-registry-key + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + .dockercfg: {{ .Values.global.repositorySecret | default .Values.repositorySecret }} +type: kubernetes.io/dockercfg \ No newline at end of file diff --git a/kubernetes/setup/values.yaml b/kubernetes/setup/values.yaml new file mode 100644 index 0000000000..49ec05807c --- /dev/null +++ b/kubernetes/setup/values.yaml @@ -0,0 +1,4 @@ +global: + # image repositories + repository: nexus3.onap.org:10001 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== diff --git a/kubernetes/so/charts/mariadb/Chart.yaml b/kubernetes/so/charts/mariadb/Chart.yaml index 1b3b5ffb23..da9cab3175 100644 --- a/kubernetes/so/charts/mariadb/Chart.yaml +++ b/kubernetes/so/charts/mariadb/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: MariaDB Service -name: so-mariadb +name: mariadb version: 2.0.0 diff --git a/kubernetes/so/charts/mariadb/templates/NOTES.txt b/kubernetes/so/charts/mariadb/templates/NOTES.txt index 87565ada20..c60c745ca3 100644 --- a/kubernetes/so/charts/mariadb/templates/NOTES.txt +++ b/kubernetes/so/charts/mariadb/templates/NOTES.txt @@ -4,16 +4,16 @@ http://{{ . }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$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 svc -w {{ include "common.name" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.service.externalPort }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ include "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} {{- end }} diff --git a/kubernetes/so/charts/mariadb/templates/clusterrolebinding.yaml b/kubernetes/so/charts/mariadb/templates/clusterrolebinding.yaml deleted file mode 100644 index df270f55e5..0000000000 --- a/kubernetes/so/charts/mariadb/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: {{ include "common.name" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin -subjects: - - kind: ServiceAccount - name: default - namespace: {{ include "common.namespace" . }} \ No newline at end of file diff --git a/kubernetes/so/charts/mariadb/templates/deployment.yaml b/kubernetes/so/charts/mariadb/templates/deployment.yaml index 9c9cf09004..3d0cd81772 100644 --- a/kubernetes/so/charts/mariadb/templates/deployment.yaml +++ b/kubernetes/so/charts/mariadb/templates/deployment.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} @@ -41,7 +41,7 @@ spec: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: - name: {{ template "common.name" . }} + name: {{ template "common.fullname" . }} key: db-root-password volumeMounts: - mountPath: /var/lib/mysql @@ -83,7 +83,7 @@ spec: {{- if .Values.persistence.enabled }} - name: mariadb-data persistentVolumeClaim: - claimName: {{ include "common.name" . }} + claimName: {{ include "common.fullname" . }} {{- else }} emptyDir: {} {{- end }} @@ -115,4 +115,4 @@ spec: hostPath: path: /etc/localtime imagePullSecrets: - - name: "{{ include "common.name" . }}-docker-registry-key" + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/so/charts/mariadb/templates/pv.yaml b/kubernetes/so/charts/mariadb/templates/pv.yaml index d60e075ca5..27343e3528 100644 --- a/kubernetes/so/charts/mariadb/templates/pv.yaml +++ b/kubernetes/so/charts/mariadb/templates/pv.yaml @@ -2,7 +2,7 @@ kind: PersistentVolume apiVersion: v1 metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/so/charts/mariadb/templates/pvc.yaml b/kubernetes/so/charts/mariadb/templates/pvc.yaml index 2271d3c37a..faff46ca3e 100644 --- a/kubernetes/so/charts/mariadb/templates/pvc.yaml +++ b/kubernetes/so/charts/mariadb/templates/pvc.yaml @@ -2,7 +2,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/so/charts/mariadb/templates/secrets.yaml b/kubernetes/so/charts/mariadb/templates/secrets.yaml index dc9761091a..b96d720778 100644 --- a/kubernetes/so/charts/mariadb/templates/secrets.yaml +++ b/kubernetes/so/charts/mariadb/templates/secrets.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} @@ -11,17 +11,3 @@ metadata: type: Opaque data: db-root-password: {{ .Values.config.mariadbRootPassword | b64enc | quote }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "common.name" . }}-docker-registry-key - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - .dockercfg: {{ .Values.global.repositorySecret | default .Values.repositorySecret }} -type: kubernetes.io/dockercfg \ No newline at end of file diff --git a/kubernetes/so/charts/mariadb/templates/service.yaml b/kubernetes/so/charts/mariadb/templates/service.yaml index 5c133b77d1..0a040bcab5 100644 --- a/kubernetes/so/charts/mariadb/templates/service.yaml +++ b/kubernetes/so/charts/mariadb/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/so/requirements.yaml b/kubernetes/so/requirements.yaml index fb8f1f6eb3..56029ab047 100644 --- a/kubernetes/so/requirements.yaml +++ b/kubernetes/so/requirements.yaml @@ -1,7 +1,7 @@ dependencies: - - name: common-templates + - name: common version: ~2.0.0 # local reference to common chart, as it is # a part of this chart's package and will not # be published independently to a repo (at this point) - repository: file://../common/common-templates \ No newline at end of file + repository: '@local' \ No newline at end of file diff --git a/kubernetes/so/templates/NOTES.txt b/kubernetes/so/templates/NOTES.txt index 0fa17a6a36..91d8ed42f1 100644 --- a/kubernetes/so/templates/NOTES.txt +++ b/kubernetes/so/templates/NOTES.txt @@ -4,16 +4,16 @@ http://{{ . }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$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 svc -w {{ include "common.name" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.service.externalPort }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "so.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "so.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} {{- end }} diff --git a/kubernetes/so/templates/clusterrolebinding.yaml b/kubernetes/so/templates/clusterrolebinding.yaml deleted file mode 100644 index df270f55e5..0000000000 --- a/kubernetes/so/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: {{ include "common.name" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin -subjects: - - kind: ServiceAccount - name: default - namespace: {{ include "common.namespace" . }} \ No newline at end of file diff --git a/kubernetes/so/templates/deployment.yaml b/kubernetes/so/templates/deployment.yaml index 2d25a46722..b66de44adc 100644 --- a/kubernetes/so/templates/deployment.yaml +++ b/kubernetes/so/templates/deployment.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} @@ -21,7 +21,7 @@ spec: - /root/ready.py args: - --container-name - - so-mariadb + - mariadb env: - name: NAMESPACE valueFrom: @@ -174,4 +174,4 @@ spec: path: start-jboss-server.sh mode: 0755 imagePullSecrets: - - name: "{{ include "common.name" . }}-docker-registry-key" + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/so/templates/namespace.yaml b/kubernetes/so/templates/namespace.yaml deleted file mode 100644 index 83eb8e7815..0000000000 --- a/kubernetes/so/templates/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: {{ include "common.namespace" . }} \ No newline at end of file diff --git a/kubernetes/so/templates/secrets.yaml b/kubernetes/so/templates/secrets.yaml deleted file mode 100644 index 269d40649d..0000000000 --- a/kubernetes/so/templates/secrets.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "common.name" . }}-docker-registry-key - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - .dockercfg: {{ .Values.global.repositorySecret | default .Values.repositorySecret }} -type: kubernetes.io/dockercfg \ No newline at end of file diff --git a/kubernetes/so/templates/service.yaml b/kubernetes/so/templates/service.yaml index f1b5322d9a..e3e4d48018 100644 --- a/kubernetes/so/templates/service.yaml +++ b/kubernetes/so/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/so/values.yaml b/kubernetes/so/values.yaml index b929fccb46..4700bb64e5 100644 --- a/kubernetes/so/values.yaml +++ b/kubernetes/so/values.yaml @@ -9,6 +9,8 @@ global: # global defaults loggingRepository: docker.elastic.co loggingImage: beats/filebeat:5.5.0 +subChartsOnly: + enabled: true # application image repository: nexus3.onap.org:10001 -- cgit 1.2.3-korg