diff options
Diffstat (limited to 'kubernetes/consul')
64 files changed, 707 insertions, 268 deletions
diff --git a/kubernetes/consul/Chart.yaml b/kubernetes/consul/Chart.yaml index b82c39b0be..8cb1f1bb99 100644 --- a/kubernetes/consul/Chart.yaml +++ b/kubernetes/consul/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: ONAP Consul Heath Monitor +description: ONAP Consul Agent name: consul -version: 1.1.0 +version: 2.0.0 diff --git a/kubernetes/consul/templates/consul-server-service.yaml b/kubernetes/consul/charts/consul-server/Chart.yaml index 1a646b4aba..13be08782b 100644 --- a/kubernetes/consul/templates/consul-server-service.yaml +++ b/kubernetes/consul/charts/consul-server/Chart.yaml @@ -12,27 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableConsulConsulServer }} apiVersion: v1 -kind: Service -metadata: - labels: - app: consul-server - name: consul-server - namespace: "{{ .Values.nsPrefix }}" -spec: - ports: - - name: consul-ui - nodePort: {{ .Values.nodePortPrefix }}70 - port: 8500 - protocol: TCP - targetPort: 8500 - - name: consul-join - nodePort: {{ .Values.nodePortPrefix }}71 - port: 8301 - protocol: TCP - targetPort: 8301 - selector: - app: consul-server - type: {{ .Values.service.type | quote }} -#{{ end }}
\ No newline at end of file +description: ONAP Consul Server +name: consul-server +version: 2.0.0 diff --git a/kubernetes/consul/charts/consul-server/requirements.yaml b/kubernetes/consul/charts/consul-server/requirements.yaml new file mode 100644 index 0000000000..f639633537 --- /dev/null +++ b/kubernetes/consul/charts/consul-server/requirements.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +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' diff --git a/kubernetes/consul/charts/consul-server/templates/NOTES.txt b/kubernetes/consul/charts/consul-server/templates/NOTES.txt new file mode 100644 index 0000000000..157fe92427 --- /dev/null +++ b/kubernetes/consul/charts/consul-server/templates/NOTES.txt @@ -0,0 +1,34 @@ +{{/* +# Copyright © 2018 Amdocs, AT&T, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + 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 {{ 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 {{ 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/consul/charts/consul-server/templates/service.yaml b/kubernetes/consul/charts/consul-server/templates/service.yaml new file mode 100644 index 0000000000..c0f8726826 --- /dev/null +++ b/kubernetes/consul/charts/consul-server/templates/service.yaml @@ -0,0 +1,63 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.portName }} + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.portName }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None +--- +kind: Service +metadata: + name: {{ include "common.servicename" . }}-ui + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type2 }} + ports: + {{if eq .Values.service.type2 "NodePort" -}} + - port: {{ .Values.service.internalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.portName2 }} + {{- else -}} + - port: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.portName2 }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/consul/charts/consul-server/templates/statefulset.yaml b/kubernetes/consul/charts/consul-server/templates/statefulset.yaml new file mode 100644 index 0000000000..bce316354b --- /dev/null +++ b/kubernetes/consul/charts/consul-server/templates/statefulset.yaml @@ -0,0 +1,69 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1beta1 +kind: StatefulSet +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + serviceName: {{ include "common.servicename" . }} + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.name" . }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + command: ["/usr/local/bin/docker-entrypoint.sh"] + args: + - "agent" + - "-bootstrap-expect={{ .Values.replicaCount }}" + - "-enable-script-checks" +{{- $fullname := include "common.fullname" . -}} +{{- $servname := include "common.servicename" . -}} +{{- range $i,$t := until (int .Values.replicaCount)}} + - "-retry-join={{ $fullname }}-{{$i}}.{{ $servname }}" +{{- end }} + - "-client=0.0.0.0" + - "-server" + - "-ui" + ports: + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} diff --git a/kubernetes/consul/charts/consul-server/values.yaml b/kubernetes/consul/charts/consul-server/values.yaml new file mode 100644 index 0000000000..671cf07c9d --- /dev/null +++ b/kubernetes/consul/charts/consul-server/values.yaml @@ -0,0 +1,66 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: docker.io +image: consul:1.0.6 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +replicaCount: 3 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 10 + periodSeconds: 5 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 5 + +service: + type: ClusterIP + name: consul-server + portName: consul-join + internalPort: 8301 + type2: NodePort + portName2: consul-ui + internalPort2: 8500 + nodePort2: 70 + +ingress: + enabled: false + +resources: {} diff --git a/kubernetes/consul/requirements.yaml b/kubernetes/consul/requirements.yaml new file mode 100644 index 0000000000..f639633537 --- /dev/null +++ b/kubernetes/consul/requirements.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +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' diff --git a/kubernetes/consul/resources/config/consul-agent-config/aai-hbase-health.json b/kubernetes/consul/resources/config/consul-agent-config/aai-hbase-health.json index 6b42e0cc4a..4260035616 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/aai-hbase-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/aai-hbase-health.json @@ -5,7 +5,7 @@ { "id": "hbase-aai", "name": "HBase Health Check", - "http": "http://hbase.{{ .Values.nsPrefix }}:8080/status/cluster", + "http": "http://aai-hbase:8080/status/cluster", "method": "GET", "header": { "Cache-Control": ["no-cache"], diff --git a/kubernetes/consul/resources/config/consul-agent-config/aai-search-data-service-health.json b/kubernetes/consul/resources/config/consul-agent-config/aai-search-data-service-health.json index 2a111d66eb..0817a19cf0 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/aai-search-data-service-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/aai-search-data-service-health.json @@ -5,7 +5,7 @@ { "id": "elasticsearch", "name": "Search Data Service Document Store", - "http": "http://aai-elasticsearch.{{ .Values.nsPrefix }}:9200/_cat/indices?v", + "http": "http://aai-elasticsearch:9200/_cat/indices?v", "interval": "15s", "timeout": "1s" }, @@ -18,7 +18,7 @@ { "id": "search-data-service-availability", "name": "Search Data Service Availability", - "script": "curl -k --cert /consul/certs/client-cert-onap.crt.pem --cert-type PEM --key /consul/certs/client-cert-onap.key.pem --key-type PEM https://search-data-service.{{ .Values.nsPrefix }}:9509/services/search-data-service/v1/jaxrsExample/jaxrs-services/echo/up 2>&1 | grep 'Up'", + "script": "curl -k --cert /consul/certs/client-cert-onap.crt.pem --cert-type PEM --key /consul/certs/client-cert-onap.key.pem --key-type PEM https://search-data-service:9509/services/search-data-service/v1/jaxrsExample/jaxrs-services/echo/up 2>&1 | grep 'Up'", "interval": "15s" }, { diff --git a/kubernetes/consul/resources/config/consul-agent-config/aai-services-health.json b/kubernetes/consul/resources/config/consul-agent-config/aai-services-health.json index 0274cd53c7..99acff4e61 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/aai-services-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/aai-services-health.json @@ -5,7 +5,7 @@ { "id": "aai-service", "name": "Core A&AI", - "http": "https://aai-service.{{ .Values.nsPrefix }}:8443/aai/util/echo", + "http": "https://aai.{{ .Release.Namespace }}:8443/aai/util/echo", "header": { "Authorization": ["Basic QUFJOkFBSQ=="], "X-TransactionId": ["ConsulHealthCheck"], @@ -18,7 +18,7 @@ { "id": "aai-resources", "name": "Resources Microservice", - "http": "https://aai-resources.{{ .Values.nsPrefix }}:8447/aai/util/echo", + "http": "https://aai-resources.{{ .Release.Namespace }}:8447/aai/util/echo", "header": { "Authorization": ["Basic QUFJOkFBSQ=="], "X-TransactionId": ["ConsulHealthCheck"], @@ -31,7 +31,7 @@ { "id": "aai-traversal", "name": "Traversal Microservice", - "http": "https://aai-traversal.{{ .Values.nsPrefix }}:8446/aai/util/echo", + "http": "https://aai-traversal.{{ .Release.Namespace }}:8446/aai/util/echo", "header": { "Authorization": ["Basic QUFJOkFBSQ=="], "X-TransactionId": ["ConsulHealthCheck"], diff --git a/kubernetes/consul/resources/config/consul-agent-config/appc-dbbuilder.json b/kubernetes/consul/resources/config/consul-agent-config/appc-dbbuilder.json index 9505246c25..c86361743a 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/appc-dbbuilder.json +++ b/kubernetes/consul/resources/config/consul-agent-config/appc-dbbuilder.json @@ -5,7 +5,7 @@ { "id": "appc-dgbuilder", "name": "APPC-Dgbuilder Server Health Check", - "http": "http://appc-dgbuilder.{{ .Values.nsPrefix }}:3000/", + "http": "http://appc-dgbuilder:3000/", "method": "HEAD", "header": { "Authorization": ["Basic ZGd1c2VyOnRlc3QxMjM="], diff --git a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb01-healthcheck.json b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb01-healthcheck.json index f36251a78f..230d31f509 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb01-healthcheck.json +++ b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb01-healthcheck.json @@ -3,9 +3,9 @@ "name": "Health Check: APPC-SDN-CTL-DB-01", "checks": [ { - "id": "appc-sdnctldb01.{{ .Values.nsPrefix }}", + "id": "appc-sdnctldb01", "name": "APPC SDNCTLDB01 Health Check", - "tcp": "appc-sdnctldb01.{{ .Values.nsPrefix }}:3306", + "tcp": "appc-sdnctldb01:3306", "interval": "10s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb02-healthcheck.json b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb02-healthcheck.json index 8c8171fe5f..da669e3ac0 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb02-healthcheck.json +++ b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnctldb02-healthcheck.json @@ -3,9 +3,9 @@ "name": "Health Check: APPC-SDN-CTL-DB-02", "checks": [ { - "id": "appc-sdnctldb02.{{ .Values.nsPrefix }}", + "id": "appc-sdnctldb02", "name": "APPC SDNCTLDB02 Health Check", - "tcp": "appc-sdnctldb02.{{ .Values.nsPrefix }}:3306", + "tcp": "appc-sdnctldb02:3306", "interval": "10s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnhost.json b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnhost.json index ec6db9d0cb..1548cab909 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/appc-sdnhost.json +++ b/kubernetes/consul/resources/config/consul-agent-config/appc-sdnhost.json @@ -5,7 +5,7 @@ { "id": "appc-sdnhost", "name": "APPC SDN Host Health Check", - "http": "http://appc-sdnhost.{{ .Values.nsPrefix }}:8282/apidoc/explorer/index.html", + "http": "http://appc-sdnhost:8282/apidoc/explorer/index.html", "method": "HEAD", "header": { "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], diff --git a/kubernetes/consul/resources/config/consul-agent-config/clamp-mariadb-health.json b/kubernetes/consul/resources/config/consul-agent-config/clamp-mariadb-health.json new file mode 100644 index 0000000000..f5ae467d74 --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/clamp-mariadb-health.json @@ -0,0 +1,16 @@ +{ + "service": { + "name": "Health Check: CLAMP - MariaDb", + "checks": [ + { + "id": "clamp-mariadb", + "name": "CLAMP Mariadb Health Check", + "script": "/consul/scripts/clamp-mariadb-script.sh", + "interval": "10s", + "timeout": "1s" + } + ] + + } +} + diff --git a/kubernetes/consul/resources/config/consul-agent-config/cli-health-check.json b/kubernetes/consul/resources/config/consul-agent-config/cli-health-check.json new file mode 100644 index 0000000000..81e55cb871 --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/cli-health-check.json @@ -0,0 +1,15 @@ +{ + "service": { + "name": "Health Check: ONAP CLI", + "checks": [ + { + "id": "cli", + "name": "CLI Health Check", + "http": "http://cli.{{include "common.namespace" .}}:8080", + "method": "GET", + "interval": "3600s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/consul/resources/config/consul-agent-config/log-elastic-search.json b/kubernetes/consul/resources/config/consul-agent-config/log-elastic-search.json index d14b16487f..6e580579e1 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/log-elastic-search.json +++ b/kubernetes/consul/resources/config/consul-agent-config/log-elastic-search.json @@ -5,7 +5,7 @@ { "id": "log-elasticsearch-server", "name": "Log Elastic Search Health Check", - "http": "http://elasticsearch.{{ .Values.nsPrefix }}:9200/_cluster/health?pretty", + "http": "http://log-es:9200/_cluster/health?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -14,7 +14,7 @@ { "id": "log-elasticsearch-tcp", "name": "Log Elastic Search TCP Health Check", - "tcp": "elasticsearchtcp.{{ .Values.nsPrefix }}:9300", + "tcp": "log-es-tcp:9300", "interval": "15s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/log-kibana.json b/kubernetes/consul/resources/config/consul-agent-config/log-kibana.json index cc72bbf3e2..6bca63f7bf 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/log-kibana.json +++ b/kubernetes/consul/resources/config/consul-agent-config/log-kibana.json @@ -5,7 +5,7 @@ { "id": "log-kibana-server", "name": "Log kibana Health Check", - "http": "http://kibana.{{ .Values.nsPrefix }}:5601/status", + "http": "http://log-kibana:5601/status", "method": "HEAD", "tls_skip_verify": true, "interval": "15s", diff --git a/kubernetes/consul/resources/config/consul-agent-config/log-logstash.json b/kubernetes/consul/resources/config/consul-agent-config/log-logstash.json index 9eb60fdf8a..ea32ecfe2a 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/log-logstash.json +++ b/kubernetes/consul/resources/config/consul-agent-config/log-logstash.json @@ -5,7 +5,7 @@ { "id": "log-logstash-internal-server-gi", "name": "Log Stash Health Check - General Information", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/?pretty", + "http": "http://log-ls-http:9600/?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -14,7 +14,7 @@ { "id": "log-logstash-internal-server-node-info", "name": "Log Stash Health Check - Node Information", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/?pretty", + "http": "http://log-ls-http:9600/_node/?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -23,7 +23,7 @@ { "id": "log-logstash-internal-server-os-info", "name": "Log Stash Health Check - OS Information", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/os?pretty", + "http": "http://log-ls-http:9600/_node/os?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -32,7 +32,7 @@ { "id": "log-logstash-internal-server-jvm-info", "name": "Log Stash Health Check - JVM Information", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/jvm?pretty", + "http": "http://log-ls-http:9600/_node/jvm?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -41,7 +41,7 @@ { "id": "log-logstash-internal-server-plugin-info", "name": "Log Stash Health Check - Plugin Information", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/plugins?pretty", + "http": "http://log-ls-http:9600/_node/plugins?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -50,7 +50,7 @@ { "id": "log-logstash-internal-server-node-stat", "name": "Log Stash Health Check - Node Stats", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/stats?pretty", + "http": "http://log-ls-http:9600/_node/stats?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -59,7 +59,7 @@ { "id": "log-logstash-internal-server-jvm-stat", "name": "Log Stash Health Check - JVM Stats", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/stats/jvm?pretty", + "http": "http://log-ls-http:9600/_node/stats/jvm?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -68,7 +68,7 @@ { "id": "log-logstash-internal-server-process-stat", "name": "Log Stash Health Check - Process Stats", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/stats/process?pretty", + "http": "http://log-ls-http:9600/_node/stats/process?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -77,7 +77,7 @@ { "id": "log-logstash-internal-server-os-stat", "name": "Log Stash Health Check - OS Stats", - "http": "http://logstashinternal.{{ .Values.nsPrefix }}:9600/_node/stats/os?pretty", + "http": "http://log-ls-http:9600/_node/stats/os?pretty", "method": "GET", "tls_skip_verify": true, "interval": "15s", @@ -86,7 +86,7 @@ { "id": "log-logstash-tcp", "name": "Log Stash File Beat TCP Health Check", - "tcp": "logstash.{{ .Values.nsPrefix }}:5044", + "tcp": "log-ls:5044", "interval": "15s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/mr-dmaap-health.json b/kubernetes/consul/resources/config/consul-agent-config/mr-dmaap-health.json index ee0d90e30a..386e226168 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/mr-dmaap-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/mr-dmaap-health.json @@ -2,7 +2,7 @@ "service": { "name": "Health Check: Message Router - DMaaP", "check": { - "http": "http://dmaap.{{ .Values.nsPrefix }}:3904/topics", + "http": "http://message-router:3904/topics", "interval": "30s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/msb-health.json b/kubernetes/consul/resources/config/consul-agent-config/msb-health.json index d15c2ef829..ad4e422be1 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/msb-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/msb-health.json @@ -3,34 +3,34 @@ "name": "Health Check: MSB", "checks": [ { - "id": "msb-eag.{{ .Values.nsPrefix }}", + "id": "msb-eag", "name": "MSB eag Health Check", - "http": "http://msb-eag.{{ .Values.nsPrefix }}:80/iui/microservices/default.html", + "http": "http://msb-eag:80/iui/microservices/default.html", "method": "HEAD", "tls_skip_verify": true, "interval": "15s", "timeout": "1s" }, { - "id": "msb-iag.{{ .Values.nsPrefix }}", + "id": "msb-iag", "name": "MSB iag Health Check", - "http": "http://msb-iag.{{ .Values.nsPrefix }}:80/iui/microservices/default.html", + "http": "http://msb-iag:80/iui/microservices/default.html", "method": "HEAD", "tls_skip_verify": true, "interval": "15s", "timeout": "1s" }, { - "id": "msb-consul.{{ .Values.nsPrefix }}", + "id": "msb-consul", "name": "MSB consul Health Check", - "tcp": "msb-consul.{{ .Values.nsPrefix }}:8500", + "tcp": "msb-consul:8500", "interval": "15s", "timeout": "1s" }, { - "id": "msb-discovery.{{ .Values.nsPrefix }}", + "id": "msb-discovery", "name": "MSB discovery Health Check", - "tcp": "msb-discovery.{{ .Values.nsPrefix }}:10081", + "tcp": "msb-discovery:10081", "interval": "15s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/mso-health.json b/kubernetes/consul/resources/config/consul-agent-config/mso-health.json deleted file mode 100644 index 1df7714a06..0000000000 --- a/kubernetes/consul/resources/config/consul-agent-config/mso-health.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "service": { - "name": "Health Check: MSO", - "checks": [ - { - "id": "mso-api-healthcheck", - "name": "MSO API Health Check", - "script": "/consul/scripts/mso-api-script.sh", - "interval": "10s", - "timeout": "1s" - }, - { - "id": "mso-camunda-healthcheck", - "name": "MSO Camunda Health Check", - "script": "/consul/scripts/mso-camunda-script.sh", - "interval": "10s", - "timeout": "1s" - }, - { - "id": "mso-jra-healthcheck", - "name": "MSO JRA Health Check", - "script": "/consul/scripts/mso-jra-script.sh", - "interval": "10s", - "timeout": "1s" - } - ] - } -} diff --git a/kubernetes/consul/resources/config/consul-agent-config/mso-mariabdb.json b/kubernetes/consul/resources/config/consul-agent-config/mso-mariabdb.json deleted file mode 100644 index 54bd2ef1fe..0000000000 --- a/kubernetes/consul/resources/config/consul-agent-config/mso-mariabdb.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "service": { - "name": "Health Check: MSO - MariaDb", - "checks": [ - { - "id": "mso-mariadb", - "name": "MSO Mariadb Health Check", - "script": "/consul/scripts/mso-mariadb-script.sh", - "interval": "10s", - "timeout": "1s" - } - ] - - } -} diff --git a/kubernetes/consul/resources/config/consul-agent-config/multicloud-health-check.json b/kubernetes/consul/resources/config/consul-agent-config/multicloud-health-check.json index dba7c77307..3757f4a6ac 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/multicloud-health-check.json +++ b/kubernetes/consul/resources/config/consul-agent-config/multicloud-health-check.json @@ -5,7 +5,7 @@ { "id": "framework", "name": "Framework Health Check", - "http": "http://framework.{{ .Values.nsPrefix }}:9001/api/multicloud/v0/swagger.json", + "http": "http://framework:9001/api/multicloud/v0/swagger.json", "method": "HEAD", "header": { "Cache-Control": ["no-cache"], @@ -19,7 +19,7 @@ { "id": "multicloud-ocata", "name": "Multicloud Ocata Health Check", - "http": "http://multicloud-ocata.{{ .Values.nsPrefix }}:9006/api/multicloud-ocata/v0/swagger.json", + "http": "http://multicloud-ocata:9006/api/multicloud-ocata/v0/swagger.json", "method": "HEAD", "header": { "Cache-Control": ["no-cache"], @@ -33,7 +33,7 @@ { "id": "multicloud-vio", "name": "Multicloud Vio Health Check", - "http": "http://multicloud-vio.{{ .Values.nsPrefix }}:9004/api/multicloud-vio/v0/swagger.json", + "http": "http://multicloud-vio:9004/api/multicloud-vio/v0/swagger.json", "method": "HEAD", "header": { "Cache-Control": ["no-cache"], @@ -47,7 +47,7 @@ { "id": "multicloud-windriver", "name": "Multicloud Windriver Health Check", - "http": "http://multicloud-windriver.{{ .Values.nsPrefix }}:9005/api/multicloud-titanium_cloud/v0/swagger.json", + "http": "http://multicloud-windriver:9005/api/multicloud-titanium_cloud/v0/swagger.json", "method": "HEAD", "header": { "Cache-Control": ["no-cache"], diff --git a/kubernetes/consul/resources/config/consul-agent-config/policy-health.json b/kubernetes/consul/resources/config/consul-agent-config/policy-health.json new file mode 100644 index 0000000000..22d135b6dd --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/policy-health.json @@ -0,0 +1,111 @@ +{ + "service": { + "name": "Health Check: Policy", + "checks": [ + { + "id": "Policy-mariadb-healthcheck", + "name": "Policy Mariadb Health Check", + "script": "/consul/scripts/policy-mariadb-script.sh", + "interval": "10s", + "timeout": "1s" + }, + { + "id": "policy-nexus-local-status", + "name": "Policy Nexus Local Status", + "http": "http://nexus:8081/nexus/service/local/status?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic YWRtaW46YWRtaW4xMjM="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "policy-nexus-internal-metrics", + "name": "Policy Nexus Internal Metrics", + "http": "http://nexus:8081/nexus/internal/metrics?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic YWRtaW46YWRtaW4xMjM="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "policy-nexus-internal-healthcheck", + "name": "Policy Nexus Internal Healthcheck", + "http": "http://nexus:8081/nexus/internal/healthcheck?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic YWRtaW46YWRtaW4xMjM="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "brmsgw-tcp", + "name": "BRMSGW Health Check", + "tcp": "brmsgw:9989", + "interval": "15s", + "timeout": "1s" + }, + { + "id": "drools", + "name": "Drools Health Check", + "http": "http://drools:6969/healthcheck?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic aGVhbHRoY2hlY2s6emIhWHp0RzM0"], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "pap", + "name": "PAP Health Check", + "http": "http://pap:9091/pap/test?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic dGVzdHBhcDphbHBoYTEyMw=="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "pdp", + "name": "PDP Health Check", + "http": "http://pdp:8081/pdp/test?pretty", + "method": "GET", + "header": { + "Authorization": ["Basic dGVzdHBkcDphbHBoYTEyMw=="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/aai-search-storage-write-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/aai-search-storage-write-script.sh index 3d26f6e71e..9ee0945d75 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/aai-search-storage-write-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/aai-search-storage-write-script.sh @@ -1,6 +1,6 @@ -if curl -s -X PUT http://aai-elasticsearch.{{ .Values.nsPrefix }}:9200/searchhealth/stats/testwrite -d @/consul/scripts/aai-search-storage-write-doc.txt | grep '\"created\":true'; then - if curl -s -X DELETE http://aai-elasticsearch.{{ .Values.nsPrefix }}:9200/searchhealth/stats/testwrite | grep '\"failed\":0'; then - if curl -s -X GET http://aai-elasticsearch.{{ .Values.nsPrefix }}:9200/searchhealth/stats/testwrite | grep '\"found\":false'; then +if curl -s -X PUT http://aai-elasticsearch:9200/searchhealth/stats/testwrite -d @/consul/scripts/aai-search-storage-write-doc.txt | grep '\"created\":true'; then + if curl -s -X DELETE http://aai-elasticsearch:9200/searchhealth/stats/testwrite | grep '\"failed\":0'; then + if curl -s -X GET http://aai-elasticsearch:9200/searchhealth/stats/testwrite | grep '\"found\":false'; then echo Successful PUT, DELETE, GET from Search Document Storage 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/appc-dbhost-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/appc-dbhost-script.sh index 5f91c5e89c..112809ce43 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/appc-dbhost-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/appc-dbhost-script.sh @@ -1,6 +1,6 @@ -APPC_DBHOST_POD=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "appc-dbhost-[^[:space:]]*") +APPC_DBHOST_POD=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "appc-dbhost-[^[:space:]]*") if [ -n "$APPC_DBHOST_POD" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $APPC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $APPC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then echo Success. APPC DBHost is running. 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh new file mode 100644 index 0000000000..2cf7fc78c5 --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh @@ -0,0 +1,15 @@ +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "[^[:space:]]*-clampdb[^[:space:]]*") + + if [ -n "$NAME" ]; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then + echo Success. CLAMP DBHost is running. 2>&1 + exit 0 + else + echo Failed. CLAMP DBHost is not running. 2>&1 + exit 1 + fi + else + echo Failed. CLAMP DBHost is offline. 2>&1 + exit 1 + fi + diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/data-router-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/data-router-script.sh index 035e7c8a38..c85efc3c17 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/data-router-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/data-router-script.sh @@ -1,8 +1,8 @@ -NAME=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "aai-data-router[^[:space:]]*") +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "aai-data-router[^[:space:]]*") if [ -n "$NAME" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $NAME -- ps -efww | grep 'java' | grep 'data-router' > /dev/null; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- ps -efww | grep 'java' | grep 'data-router' > /dev/null; then echo Success. Synapse process is running. 2>&1 exit 0 diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/model-loader-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/model-loader-script.sh index 9a4b4df28f..a8babec102 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/model-loader-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/model-loader-script.sh @@ -1,8 +1,8 @@ -NAME=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "aai-model-loader[^[:space:]]*") +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "aai-model-loader[^[:space:]]*") if [ -n "$NAME" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $NAME -- ps -efww | grep 'java' | grep 'model-loader' > /dev/null; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- ps -efww | grep 'java' | grep 'model-loader' > /dev/null; then echo Success. Model Loader process is running. 2>&1 exit 0 diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh index a109032d3b..fd4587551d 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh @@ -1,6 +1,6 @@ -kafkapod=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "message-router-global-kafka-[^[:space:]]*") +kafkapod=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "message-router-kafka-[^[:space:]]*") if [ -n "$kafkapod" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $kafkapod -- ps ef | grep -i kafka; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $kafkapod -- ps ef | grep -i kafka; then echo Success. Kafka process is running. 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh index 47c42d54ef..fb34057bfc 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh @@ -1,6 +1,6 @@ -zkpod=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "message-router-zookeeper-[^[:space:]]*") +zkpod=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "message-router-zookeeper-[^[:space:]]*") if [ -n "$zkpod" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $zkpod -- ps ef | grep -i zookeeper; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $zkpod -- ps ef | grep -i zookeeper; then echo Success. Zookeeper process is running. 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-mariadb-script.sh deleted file mode 100755 index aa73a73050..0000000000 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-mariadb-script.sh +++ /dev/null @@ -1,14 +0,0 @@ -NAME=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "mso-mariadb[^[:space:]]*") - - if [ -n "$NAME" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then - echo Success. mariadb process is running. 2>&1 - exit 0 - else - echo Failed. mariadb process is not running. 2>&1 - exit 1 - fi - else - echo Failed. mariadb container is offline. 2>&1 - exit 1 - fi diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/policy-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/policy-mariadb-script.sh new file mode 100644 index 0000000000..29dbe3f864 --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/policy-mariadb-script.sh @@ -0,0 +1,14 @@ +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "[^[:space:]]*-policydb[^[:space:]]*") + + if [ -n "$NAME" ]; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then + echo Success. mariadb process is running. 2>&1 + exit 0 + else + echo Failed. mariadb process is not running. 2>&1 + exit 1 + fi + else + echo Failed. mariadb container is offline. 2>&1 + exit 1 + fi diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-be-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-be-script.sh index 00a05648d3..f007e62226 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-be-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-be-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://sdc-fe.{{ .Values.nsPrefix }}:8181/sdc1/rest/healthCheck" +HEALTH_CHECK_ENDPOINT="http://sdc-fe:8181/sdc1/rest/healthCheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) ## Strip out the ON_BOARDING section from the response XML (otherwise we will diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-cs-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-cs-script.sh index 9950cc9fdf..a9ba31a266 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-cs-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-cs-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://sdc-fe.{{ .Values.nsPrefix }}:8181/sdc1/rest/healthCheck" +HEALTH_CHECK_ENDPOINT="http://sdc-fe:8181/sdc1/rest/healthCheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) ## Strip out the ON_BOARDING section from the response XML (otherwise we will diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-fe-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-fe-script.sh index 27f3b224c6..4e3664ba73 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-fe-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-fe-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://sdc-fe.{{ .Values.nsPrefix }}:8181/sdc1/rest/healthCheck" +HEALTH_CHECK_ENDPOINT="http://sdc-fe:8181/sdc1/rest/healthCheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) ## Strip out the ON_BOARDING section from the response XML (otherwise we will diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-titan-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-titan-script.sh index c5955f3be3..85fc4319ff 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-titan-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdc-titan-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://sdc-fe.{{ .Values.nsPrefix }}:8181/sdc1/rest/healthCheck" +HEALTH_CHECK_ENDPOINT="http://sdc-fe:8181/sdc1/rest/healthCheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) ## Strip out the ON_BOARDING section from the response XML (otherwise we will diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdnc-dbhost-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdnc-dbhost-script.sh index 27b9b9f608..74064816a2 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sdnc-dbhost-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sdnc-dbhost-script.sh @@ -1,6 +1,6 @@ -SDNC_DBHOST_POD=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "sdnc-dbhost-[^[:space:]]*") +SDNC_DBHOST_POD=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "sdnc-dbhost-[^[:space:]]*") if [ -n "$SDNC_DBHOST_POD" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $SDNC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $SDNC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then echo Success. SDNC DBHost is running. 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/search-data-service-availability.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/search-data-service-availability.sh index d5118736cd..12bf9bf061 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/search-data-service-availability.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/search-data-service-availability.sh @@ -1,6 +1,6 @@ #!/bin/sh -SEARCH_SERVICE_NAME="search-data-service.{{ .Values.nsPrefix }}" +SEARCH_SERVICE_NAME="search-data-service.{{ include "common.namespace" . }}" SEARCH_SERVICE_PORT=9509 HEALTH_CHECK_INDEX="healthcheck" diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-camunda-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-api-script.sh index 341ff193e9..047d2cb6f1 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-camunda-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-api-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://mso.{{ .Values.nsPrefix }}:8080/mso/healthcheck" +HEALTH_CHECK_ENDPOINT="http://so:8080/ecomp/mso/infra/healthcheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready") diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-jra-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-camunda-script.sh index beeb289517..9ad3ffc5cf 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-jra-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-camunda-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://mso.{{ .Values.nsPrefix }}:8080/networks/rest/healthcheck" +HEALTH_CHECK_ENDPOINT="http://so:8080/mso/healthcheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready") diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-api-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-jra-script.sh index 8f3f85ce5e..96d9c7a765 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/mso-api-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-jra-script.sh @@ -1,5 +1,5 @@ ## Query the health check API. -HEALTH_CHECK_ENDPOINT="http://mso.{{ .Values.nsPrefix }}:8080/ecomp/mso/infra/healthcheck" +HEALTH_CHECK_ENDPOINT="http://so:8080/networks/rest/healthcheck" HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT) READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready") diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/so-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-mariadb-script.sh new file mode 100755 index 0000000000..e8135cb55c --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/so-mariadb-script.sh @@ -0,0 +1,14 @@ +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "[^[:space:]]*-so-db[^[:space:]]*") + + if [ -n "$NAME" ]; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then + echo Success. mariadb process is running. 2>&1 + exit 0 + else + echo Failed. mariadb process is not running. 2>&1 + exit 1 + fi + else + echo Failed. mariadb container is offline. 2>&1 + exit 1 + fi diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/sparky-be-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/sparky-be-script.sh index 7796681902..15175aa80f 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/sparky-be-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/sparky-be-script.sh @@ -1,8 +1,8 @@ -NAME=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "aai-sparky-be[^[:space:]]*") +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "aai-sparky-be[^[:space:]]*") if [ -n "$NAME" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $NAME -- ps -efww | grep 'java' | grep 'sparky' > /dev/null; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- ps -efww | grep 'java' | grep 'sparky' > /dev/null; then echo Success. UI Backend Service process is running. 2>&1 exit 0 diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/tabular-db-availability.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/tabular-db-availability.sh index dc7768fc6e..f2c7c587ff 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/tabular-db-availability.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/tabular-db-availability.sh @@ -1,13 +1,13 @@ # Query the Hbase service for the cluster status. -GET_CLUSTER_STATUS_RESPONSE=$(curl -si -X GET -H "Accept: text/xml" http://hbase.{{ .Values.nsPrefix }}:8080/status/cluster) +GET_CLUSTER_STATUS_RESPONSE=$(curl -si -X GET -H "Accept: text/xml" http://aai-hbase:8080/status/cluster) if [ -z "$GET_CLUSTER_STATUS_RESPONSE" ]; then echo "Tabular store is unreachable." - return 2 + return 2 fi -# Check the resulting status JSON to see if there is a 'DeadNodes' stanza with +# Check the resulting status JSON to see if there is a 'DeadNodes' stanza with # entries. DEAD_NODES=$(echo $GET_CLUSTER_STATUS_RESPONSE | grep "<DeadNodes/>") diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/vid-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/vid-mariadb-script.sh index bbb080f44d..5ac5c8b844 100755 --- a/kubernetes/consul/resources/config/consul-agent-config/scripts/vid-mariadb-script.sh +++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/vid-mariadb-script.sh @@ -1,7 +1,7 @@ -NAME=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "vid-mariadb[^[:space:]]*") +NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "[^[:space:]]*-vid-mariadb[^[:space:]]*") if [ -n "$NAME" ]; then - if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then + if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then echo Success. mariadb process is running. 2>&1 exit 0 else diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdc-health.json b/kubernetes/consul/resources/config/consul-agent-config/sdc-health.json index ec8ec86c25..105635b592 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdc-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdc-health.json @@ -33,7 +33,7 @@ { "id": "sdc-catalog-healthcheck", "name": "SDC Catalog Health Check", - "http": "https://sdc-be.{{ .Values.nsPrefix }}:8443/asdc/v1/catalog/services", + "http": "https://sdc-be:8443/asdc/v1/catalog/services", "header": { "Authorization": ["Basic dmlkOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="], "X-ECOMP-InstanceID": ["VID"], diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-dgbuilder.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-dgbuilder.json index 6ae14afac6..72e6be9093 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-dgbuilder.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-dgbuilder.json @@ -5,7 +5,7 @@ { "id": "sdnc-dgbuilder", "name": "SDNC-DGbuilder Health Check", - "http": "http://sdnc-dgbuilder.{{ .Values.nsPrefix }}:3000/", + "http": "http://sdnc-dgbuilder:3000/", "method": "HEAD", "header": { "Authorization": ["Basic ZGd1c2VyOnRlc3QxMjM="], diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-health.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-health.json index 0ee5e8951d..5f42835cf7 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-health.json @@ -5,7 +5,7 @@ { "id": "odl-api-healthcheck", "name": "SDNC API Health Check", - "http": "http://sdnhost.{{ .Values.nsPrefix }}:8282/restconf/operations/SLI-API:healthcheck", + "http": "http://sdnc:8282/restconf/operations/SLI-API:healthcheck", "method": "POST", "header": { "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-portal-health.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-portal-health.json index 092df058e3..d03ce90820 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-portal-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-portal-health.json @@ -5,7 +5,7 @@ { "id": "sdnc-portal", "name": "SDNC Portal Health Check", - "http": "http://sdnc-portal.{{ .Values.nsPrefix }}:8843/login", + "http": "http://sdnc-portal:8843/login", "method": "HEAD", "header": { "Cache-Control": ["no-cache"], diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb01-healthcheck.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb01-healthcheck.json index ed4a29d7f6..e684c09da8 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb01-healthcheck.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb01-healthcheck.json @@ -3,9 +3,9 @@ "name": "Health Check: SDNC-SDN-CTL-DB-01", "checks": [ { - "id": "sdnctldb01.{{ .Values.nsPrefix }}", + "id": "sdnctldb01", "name": "SDNC SDNCTLDB01 Health Check", - "tcp": "sdnctldb01.{{ .Values.nsPrefix }}:3306", + "tcp": "sdnc-dbhost:3306", "interval": "10s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb02-healthcheck.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb02-healthcheck.json index 8c4700b6f0..ae4820a3e6 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb02-healthcheck.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnctldb02-healthcheck.json @@ -3,9 +3,9 @@ "name": "Health Check: SDNC-SDN-CTL-DB-02", "checks": [ { - "id": "sdnctldb02.{{ .Values.nsPrefix }}", + "id": "sdnctldb02", "name": "SDNC SDNCTLDB02 Health Check", - "tcp": "sdnctldb02.{{ .Values.nsPrefix }}:3306", + "tcp": "sdnc-dbhost:3306", "interval": "10s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnhost.json b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnhost.json index 585b9c0b69..604b5be901 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnhost.json +++ b/kubernetes/consul/resources/config/consul-agent-config/sdnc-sdnhost.json @@ -5,7 +5,7 @@ { "id": "sdnc-sdnhost", "name": "SDNC SDN Host Health Check", - "http": "http://sdnhost.{{ .Values.nsPrefix }}:8282/apidoc/explorer/index.html", + "http": "http://sdnhost:8282/apidoc/explorer/index.html", "method": "HEAD", "header": { "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], diff --git a/kubernetes/consul/resources/config/consul-agent-config/so-health.json b/kubernetes/consul/resources/config/consul-agent-config/so-health.json new file mode 100644 index 0000000000..565c4a4a7a --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/so-health.json @@ -0,0 +1,28 @@ +{ + "service": { + "name": "Health Check: SO", + "checks": [ + { + "id": "so-api-healthcheck", + "name": "SO API Health Check", + "script": "/consul/scripts/so-api-script.sh", + "interval": "10s", + "timeout": "1s" + }, + { + "id": "so-camunda-healthcheck", + "name": "SO Camunda Health Check", + "script": "/consul/scripts/so-camunda-script.sh", + "interval": "10s", + "timeout": "1s" + }, + { + "id": "so-jra-healthcheck", + "name": "SO JRA Health Check", + "script": "/consul/scripts/so-jra-script.sh", + "interval": "10s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/consul/resources/config/consul-agent-config/so-mariabdb.json b/kubernetes/consul/resources/config/consul-agent-config/so-mariabdb.json new file mode 100644 index 0000000000..fb554208e4 --- /dev/null +++ b/kubernetes/consul/resources/config/consul-agent-config/so-mariabdb.json @@ -0,0 +1,15 @@ +{ + "service": { + "name": "Health Check: SO - MariaDb", + "checks": [ + { + "id": "so-mariadb", + "name": "SO Mariadb Health Check", + "script": "/consul/scripts/so-mariadb-script.sh", + "interval": "10s", + "timeout": "1s" + } + ] + + } +} diff --git a/kubernetes/consul/resources/config/consul-agent-config/vfc-health.json b/kubernetes/consul/resources/config/consul-agent-config/vfc-health.json index 5ace3e4d9b..3661ac708b 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/vfc-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/vfc-health.json @@ -3,107 +3,114 @@ "name": "Health Check: VFC", "checks": [ { - "id": "vfc-catalog.{{ .Values.nsPrefix }}", + "id": "vfc-catalog", "name": "VFC catalog Health Check", - "tcp": "vfc-catalog.{{ .Values.nsPrefix }}:8806", + "tcp": "vfc-catalog:8806", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-emsdriver.{{ .Values.nsPrefix }}", + "id": "vfc-emsdriver", "name": "VFC emsdriver Health Check", - "tcp": "vfc-emsdriver.{{ .Values.nsPrefix }}:8206", + "tcp": "vfc-ems-driver:8206", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-gvnfmdriver.{{ .Values.nsPrefix }}", + "id": "vfc-gvnfmdriver", "name": "VFC gvnfmdriver Health Check", - "tcp": "vfc-gvnfmdriver.{{ .Values.nsPrefix }}:8484", + "tcp": "vfc-generic-vnfm-driver:8484", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-hwvnfmdriver.{{ .Values.nsPrefix }}", + "id": "vfc-hwvnfmdriver", "name": "VFC hwvnfmdriver Health Check", - "tcp": "vfc-hwvnfmdriver.{{ .Values.nsPrefix }}:8482", + "tcp": "vfc-huawei-vnfm-driver:8482", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-jujudriver.{{ .Values.nsPrefix }}", + "id": "vfc-jujudriver", "name": "VFC jujudriver Health Check", - "tcp": "vfc-jujudriver.{{ .Values.nsPrefix }}:8483", + "tcp": "vfc-juju-vnfm-driver:8483", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-nokiavnfmdriver.{{ .Values.nsPrefix }}", + "id": "vfc-nokiavnfmdriver", "name": "VFC nokiavnfmdriver Health Check", - "tcp": "vfc-nokiavnfmdriver.{{ .Values.nsPrefix }}:8486", + "tcp": "vfc-nokia-vnfm-driver:8486", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-nslcm.{{ .Values.nsPrefix }}", + "id": "vfc-nokiav2vnfmdriver", + "name": "VFC nokiav2vnfmdriver Health Check", + "tcp": "vfc-nokia-v2vnfm-driver:8089", + "interval": "15s", + "timeout": "1s" + }, + { + "id": "vfc-nslcm", "name": "VFC nslcm Health Check", - "tcp": "vfc-nslcm.{{ .Values.nsPrefix }}:8403", + "tcp": "vfc-nslcm:8403", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-resmgr.{{ .Values.nsPrefix }}", + "id": "vfc-resmgr", "name": "VFC resmgr Health Check", - "tcp": "vfc-resmgr.{{ .Values.nsPrefix }}:8480", + "tcp": "vfc-resmgr:8480", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-vnflcm.{{ .Values.nsPrefix }}", + "id": "vfc-vnflcm", "name": "VFC vnflcm Health Check", - "tcp": "vfc-vnflcm.{{ .Values.nsPrefix }}:8801", + "tcp": "vfc-vnflcm:8801", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-vnfmgr.{{ .Values.nsPrefix }}", + "id": "vfc-vnfmgr", "name": "VFC vnfmgr Health Check", - "tcp": "vfc-vnfmgr.{{ .Values.nsPrefix }}:8803", + "tcp": "vfc-vnfmgr:8803", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-vnfres.{{ .Values.nsPrefix }}", + "id": "vfc-vnfres", "name": "VFC vnfres Health Check", - "tcp": "vfc-vnfres.{{ .Values.nsPrefix }}:8802", + "tcp": "vfc-vnfres:8802", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-workflow.{{ .Values.nsPrefix }}", + "id": "vfc-workflow", "name": "VFC workflow Health Check", - "tcp": "vfc-workflow.{{ .Values.nsPrefix }}:10550", + "tcp": "vfc-workflow:10550", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-workflowengineactiviti.{{ .Values.nsPrefix }}", + "id": "vfc-workflowengineactiviti", "name": "VFC workflow-engine Health Check", - "tcp": "vfc-workflowengineactiviti.{{ .Values.nsPrefix }}:8080", + "tcp": "vfc-workflow-engine:8080", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-ztesdncdriver.{{ .Values.nsPrefix }}", + "id": "vfc-ztesdncdriver", "name": "VFC ztesdncdriver Health Check", - "tcp": "vfc-ztesdncdriver.{{ .Values.nsPrefix }}:8411", + "tcp": "vfc-zte-sdnc-driver:8411", "interval": "15s", "timeout": "1s" }, { - "id": "vfc-ztevnfmdriver.{{ .Values.nsPrefix }}", + "id": "vfc-ztevnfmdriver", "name": "VFC ztevnfmdriver Health Check", - "tcp": "vfc-ztevnfmdriver.{{ .Values.nsPrefix }}:8410", + "tcp": "vfc-zte-vnfm-driver:8410", "interval": "15s", "timeout": "1s" } diff --git a/kubernetes/consul/resources/config/consul-agent-config/vid-health.json b/kubernetes/consul/resources/config/consul-agent-config/vid-health.json index 2dc6f0a9dc..d6d8d4c03d 100644 --- a/kubernetes/consul/resources/config/consul-agent-config/vid-health.json +++ b/kubernetes/consul/resources/config/consul-agent-config/vid-health.json @@ -5,7 +5,7 @@ { "id": "vid-server", "name": "VID Server Health Check", - "http": "http://vid-server.{{ .Values.nsPrefix }}:8080/vid/healthCheck", + "http": "http://vid:8080/vid/healthCheck", "method": "GET", "header": { "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], diff --git a/kubernetes/consul/templates/consul-agent-configmap.yaml b/kubernetes/consul/templates/configmap.yaml index 57d52c4de1..a4270d3c87 100644 --- a/kubernetes/consul/templates/consul-agent-configmap.yaml +++ b/kubernetes/consul/templates/configmap.yaml @@ -12,28 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableConsulConsulAgent }} apiVersion: v1 kind: ConfigMap metadata: - name: consul-agent-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/consul-agent-config/*").AsConfig . | indent 2 }} --- apiVersion: v1 kind: ConfigMap metadata: - name: consul-agent-scripts-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-scripts-configmap + namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/consul-agent-config/scripts/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: consul-agent-certs-secret - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/consul-agent-config/certs/*").AsSecrets . | indent 2 }} -#{{ end }} diff --git a/kubernetes/consul/templates/consul-server-deployment.yaml b/kubernetes/consul/templates/consul-server-deployment.yaml deleted file mode 100644 index 50dfb77d5e..0000000000 --- a/kubernetes/consul/templates/consul-server-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#{{ if not .Values.disableConsulConsulServer }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: consul-server - name: consul-server - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.consulServerReplicas }} - selector: - matchLabels: - app: consul-server - template: - metadata: - labels: - app: consul-server - name: consul-server - spec: - containers: - - image: "{{ .Values.consulserverRegistry }}" - command: ["/usr/local/bin/docker-entrypoint.sh"] - args: ["agent","-server","-client","0.0.0.0","-enable-script-checks","-bootstrap-expect=3","-ui","-join","consul-server.{{ .Values.nsPrefix }}"] - name: consul-server -#{{ end }} diff --git a/kubernetes/consul/templates/consul-agent-deployment.yaml b/kubernetes/consul/templates/deployment.yaml index 2c4a14a9b6..d37521b5e6 100644 --- a/kubernetes/consul/templates/consul-agent-deployment.yaml +++ b/kubernetes/consul/templates/deployment.yaml @@ -12,32 +12,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableConsulConsulAgent }} apiVersion: extensions/v1beta1 kind: Deployment metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} labels: - app: consul-agent - name: consul-agent - namespace: "{{ .Values.nsPrefix }}" + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} spec: - replicas: {{ .Values.consulAgentReplicas }} + replicas: {{ .Values.replicaCount }} selector: matchLabels: - app: consul-agent + app: {{ include "common.name" . }} template: metadata: labels: - app: consul-agent - name: consul-agent + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + name: {{ include "common.name" . }} spec: + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" containers: - - image: "{{ .Values.consulagentRegistry }}" - command: ["/usr/local/bin/docker-entrypoint.sh"] - args: ["agent","-client","0.0.0.0","-enable-script-checks","-join","consul-server.{{ .Values.nsPrefix }}"] - name: consul-server + - image: "{{ include "common.repository" . }}/{{ .Values.image }}" + command: + - /bin/sh + - "-c" + - | + cp /tmp/consul/config/* /consul/config + /usr/local/bin/docker-entrypoint.sh agent -client 0.0.0.0 -enable-script-checks -retry-join {{ .Values.consulServer.nameOverride }} + name: {{ include "common.name" . }} volumeMounts: - - mountPath: /consul/config + - mountPath: /tmp/consul/config name: consul-agent-config - mountPath: /consul/scripts name: consul-agent-scripts-config @@ -45,13 +54,12 @@ spec: name: consul-agent-certs-config volumes: - configMap: - name: consul-agent-configmap + name: {{ include "common.fullname" . }}-configmap name: consul-agent-config - configMap: - name: consul-agent-scripts-configmap + name: {{ include "common.fullname" . }}-scripts-configmap defaultMode: 0755 name: consul-agent-scripts-config - secret: - secretName: consul-agent-certs-secret + secretName: {{ include "common.fullname" . }}-certs-secret name: consul-agent-certs-config -#{{ end }} diff --git a/kubernetes/consul/templates/secrets.yaml b/kubernetes/consul/templates/secrets.yaml new file mode 100644 index 0000000000..2535437329 --- /dev/null +++ b/kubernetes/consul/templates/secrets.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-certs-secret + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/consul-agent-config/certs/*").AsSecrets . | indent 2 }} diff --git a/kubernetes/consul/values.yaml b/kubernetes/consul/values.yaml index e86937a34c..abfc9ef0ef 100644 --- a/kubernetes/consul/values.yaml +++ b/kubernetes/consul/values.yaml @@ -11,12 +11,53 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 -nsPrefix: "onap" -nodePortPrefix: 302 -consulserverRegistry: "docker.io/consul:1.0.6" -consulagentRegistry: "oomk8s/consul:1.0.0" -consulAgentReplicas: 1 -consulServerReplicas: 3 -service: - type: NodePort +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: docker.io +image: oomk8s/consul:1.0.0 +pullPolicy: Always + +#subchart name +consulServer: + nameOverride: consul-server + +# flag to enable debugging - application support required +debugEnabled: false + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 90 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 90 + periodSeconds: 10 + +service: {} + +ingress: + enabled: false + +resources: {} |