From: Rahul Date: Tue, 5 Dec 2023 11:26:09 +0000 (+0000) Subject: Revert "Feature 11008: Update of OSM Helm installer to latest versions" X-Git-Tag: release-v15.0-start~3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F14111%2F2;p=osm%2Fdevops.git Revert "Feature 11008: Update of OSM Helm installer to latest versions" This reverts commit 7ecb4e809e72c4c4c3c33e8a30f2c6050e30b03e. Change-Id: I58e2276e4b7af5f31bee77a21e28fb00e209bf07 Signed-off-by: Rahul --- diff --git a/Dockerfile b/Dockerfile index af9296a6..fc5f5bd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,18 @@ -# 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 +# Copyright 2021 Canonical Ltd. # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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. +# 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. +# +## ######################################################################################## # This Dockerfile is intented for devops testing and deb package generation # @@ -21,7 +24,7 @@ # devops-stages/stage-build.sh # -FROM ubuntu:22.04 +FROM ubuntu:20.04 ARG APT_PROXY RUN if [ ! -z $APT_PROXY ] ; then \ @@ -32,21 +35,22 @@ RUN if [ ! -z $APT_PROXY ] ; then \ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ debhelper \ - dh-python \ + dh-make \ git \ python3 \ python3-all \ python3-dev \ - python3-setuptools \ - python3-pip \ - tox + python3-setuptools + +RUN python3 -m easy_install pip==21.3.1 +RUN pip install tox==3.24.5 ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - dh-make + unzip RUN curl https://get.helm.sh/helm-v3.11.3-linux-amd64.tar.gz --output helm-v3.11.3.tar.gz \ && tar -zxvf helm-v3.11.3.tar.gz \ diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh index f6ba3854..f7cc2141 100755 --- a/devops-stages/stage-build.sh +++ b/devops-stages/stage-build.sh @@ -14,9 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -# Download helm chart dependencies -helm dependency update installers/helm/osm - PKG_DIRECTORIES="common jenkins installers tools docker" MDG_NAME=devops DEB_INSTALL=debian/osm-$MDG_NAME.install diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 175835f3..1e2f913c 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -39,9 +39,6 @@ for charm in $OLD_CHARMS_NAMES; do fi done -# Download helm chart dependencies -helm dependency update installers/helm/osm - # Execute linting test for OSM helm chart helm lint installers/helm/osm diff --git a/installers/helm/osm/Chart.yaml b/installers/helm/osm/Chart.yaml index 2c6b6275..8d44eb49 100644 --- a/installers/helm/osm/Chart.yaml +++ b/installers/helm/osm/Chart.yaml @@ -21,17 +21,16 @@ type: application icon: https://www.etsi.org/images/articles/logos/OSM.png version: 0.0.1 appVersion: "14" -dependencies: -- name: mysql - repository: "https://charts.bitnami.com/bitnami" - version: "9.12.3" - condition: mysql.enabled -- name: kafka - repository: "https://charts.bitnami.com/bitnami" - version: "25.1.12" - condition: kafka.enabled -- name: zookeeper - repository: "https://charts.bitnami.com/bitnami" - version: "12.1.3" - condition: zookeeper.enabled - +# dependencies: +# - name: mongodb +# repository: "https://charts.bitnami.com/bitnami" +# version: "13.9.4" +# condition: mongodb.enabled +# - name: airflow +# repository: "https://airflow.apache.org" +# version: "1.6.0" +# condition: airflow.enabled +# - name: mysql +# repository: "https://charts.bitnami.com/bitnami" +# version: "9.9.1" +# condition: mysql.enabled diff --git a/installers/helm/osm/templates/grafana/grafana-deployment.yaml b/installers/helm/osm/templates/grafana/grafana-deployment.yaml index c39f4e81..a54d6878 100644 --- a/installers/helm/osm/templates/grafana/grafana-deployment.yaml +++ b/installers/helm/osm/templates/grafana/grafana-deployment.yaml @@ -63,7 +63,7 @@ spec: secretKeyRef: key: admin-password name: grafana - image: grafana/grafana:10.1.2 + image: grafana/grafana:8.1.1 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 10 @@ -154,4 +154,4 @@ spec: name: sc-dashboard-provider - emptyDir: {} name: sc-datasources-volume -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/installers/helm/osm/templates/kafka/kafka-configmap.yaml b/installers/helm/osm/templates/kafka/kafka-configmap.yaml new file mode 100644 index 00000000..f967734d --- /dev/null +++ b/installers/helm/osm/templates/kafka/kafka-configmap.yaml @@ -0,0 +1,34 @@ +{{- if .Values.kafka.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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: ConfigMap +metadata: + name: {{ include "osm.fullname" . }}-kafka-configmap + labels: + {{- include "osm.labels" . | nindent 4 }} +data: + KAFKA_ADVERTISED_HOST_NAME: kafka.osm + KAFKA_ADVERTISED_PORT: "9092" + KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" + KAFKA_LOG_RETENTION_HOURS: "24" + KAFKA_BROKER_ID: "1" + KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://:9092" + KAFKA_LISTENERS: "PLAINTEXT://:9092" + KAFKA_INTER_BROKER_LISTENER_NAME: "PLAINTEXT" + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1" +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/kafka/kafka-service.yaml b/installers/helm/osm/templates/kafka/kafka-service.yaml new file mode 100644 index 00000000..73a0a050 --- /dev/null +++ b/installers/helm/osm/templates/kafka/kafka-service.yaml @@ -0,0 +1,34 @@ +{{- if .Values.kafka.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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: kafka + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.kafka.service.port }} + targetPort: 9092 + protocol: TCP + selector: + app.kubernetes.io/component: kafka + {{- include "osm.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/kafka/kafka-statefulset.yaml b/installers/helm/osm/templates/kafka/kafka-statefulset.yaml new file mode 100644 index 00000000..81563eb2 --- /dev/null +++ b/installers/helm/osm/templates/kafka/kafka-statefulset.yaml @@ -0,0 +1,88 @@ +{{- if .Values.kafka.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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/v1 +kind: StatefulSet +metadata: + name: kafka + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.kafka.replicaCount | default .Values.global.replicaCount }} + serviceName: kafka + selector: + matchLabels: + app.kubernetes.io/component: kafka + {{- include "osm.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.global.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app.kubernetes.io/component: kafka + {{- include "osm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "osm.serviceAccountName" . }} + initContainers: + - name: zookeeper-test + image: alpine:latest + command: ["sh", "-c", "until nc -zvw1 zookeeper 2181; do sleep 3; done; exit 0"] + containers: + - name: kafka + securityContext: + # readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + # runAsNonRoot: true + image: wurstmeister/kafka:2.11-1.0.2 + imagePullPolicy: {{ .Values.global.image.pullPolicy }} + ports: + - containerPort: 9092 + protocol: TCP + volumeMounts: + - name: socket + mountPath: /var/run/docker.sock + resources: + limits: + memory: 1024Mi + requests: + memory: 128Mi + envFrom: + - configMapRef: + name: {{ include "osm.fullname" . }}-kafka-configmap + {{- with .Values.global.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - name: socket + hostPath: + path: /var/run/docker.sock +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/keystone/keystone-deployment.yaml b/installers/helm/osm/templates/keystone/keystone-deployment.yaml index e8b798e3..bf44346d 100644 --- a/installers/helm/osm/templates/keystone/keystone-deployment.yaml +++ b/installers/helm/osm/templates/keystone/keystone-deployment.yaml @@ -72,8 +72,8 @@ spec: - name: ROOT_DB_PASSWORD valueFrom: secretKeyRef: - name: mysql - key: mysql-root-password + name: {{ include "osm.fullname" . }}-secret + key: OSM_MYSQL_ROOT_PASSWORD - name: KEYSTONE_DB_PASSWORD valueFrom: secretKeyRef: @@ -97,4 +97,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/mysql/mysql-service.yaml b/installers/helm/osm/templates/mysql/mysql-service.yaml new file mode 100644 index 00000000..a2bb113c --- /dev/null +++ b/installers/helm/osm/templates/mysql/mysql-service.yaml @@ -0,0 +1,34 @@ +{{- if .Values.mysql.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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: mysql + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.mysql.service.port }} + targetPort: 3306 + protocol: TCP + selector: + app.kubernetes.io/component: mysql + {{- include "osm.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/mysql/mysql-statefulset.yaml b/installers/helm/osm/templates/mysql/mysql-statefulset.yaml new file mode 100644 index 00000000..1a18f4a3 --- /dev/null +++ b/installers/helm/osm/templates/mysql/mysql-statefulset.yaml @@ -0,0 +1,94 @@ +{{- if .Values.mysql.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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/v1 +kind: StatefulSet +metadata: + name: mysql + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.mysql.replicaCount | default .Values.global.replicaCount }} + serviceName: mysql + selector: + matchLabels: + app.kubernetes.io/component: mysql + {{- include "osm.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.global.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app.kubernetes.io/component: mysql + {{- include "osm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "osm.serviceAccountName" . }} + containers: + - name: mysql + securityContext: + # readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + # runAsNonRoot: true + image: mysql:8.0.34 + imagePullPolicy: {{ .Values.global.image.pullPolicy }} + ports: + - containerPort: 3306 + protocol: TCP + name: mysql + volumeMounts: + - name: mysql-db + mountPath: /var/lib/mysql + resources: + limits: + memory: 1024Mi + requests: + memory: 128Mi + envFrom: + {{- if not .Values.mysql.useOsmSecret }} + - secretRef: + name: {{ .Values.mysql.secretName | default "ro-db-secret" }} + {{- else }} + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "osm.fullname" . }}-secret + key: OSM_MYSQL_ROOT_PASSWORD + {{- end }} + {{- with .Values.global.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - name: mysql-db + hostPath: + path: {{ .Values.mysql.dbHostPath | default "/var/lib/osm/{{ .Release.Namespace }}/osm_ro_db/_data" }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/prometheus/prometheus-statefulset.yaml b/installers/helm/osm/templates/prometheus/prometheus-statefulset.yaml index 96f22813..476ab4f0 100644 --- a/installers/helm/osm/templates/prometheus/prometheus-statefulset.yaml +++ b/installers/helm/osm/templates/prometheus/prometheus-statefulset.yaml @@ -63,7 +63,7 @@ spec: # readOnlyRootFilesystem: true allowPrivilegeEscalation: false # runAsNonRoot: true - image: prom/prometheus:v2.47.0 + image: prom/prometheus:v2.28.1 imagePullPolicy: {{ .Values.global.image.pullPolicy }} args: - --config.file=/etc/prometheus/prometheus.yml @@ -138,4 +138,4 @@ spec: - key: osm_alert_rules.yml path: osm_alert_rules.yml {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/ro/ro-deployment.yaml b/installers/helm/osm/templates/ro/ro-deployment.yaml index 7319ebd1..7c07534a 100644 --- a/installers/helm/osm/templates/ro/ro-deployment.yaml +++ b/installers/helm/osm/templates/ro/ro-deployment.yaml @@ -81,8 +81,8 @@ spec: - name: RO_DB_ROOT_PASSWORD valueFrom: secretKeyRef: - name: mysql - key: mysql-root-password + name: {{ include "osm.fullname" . }}-secret + key: OSM_MYSQL_ROOT_PASSWORD {{- end }} {{- with .Values.global.nodeSelector }} nodeSelector: @@ -96,4 +96,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/zookeeper/zookeeper-service.yaml b/installers/helm/osm/templates/zookeeper/zookeeper-service.yaml new file mode 100644 index 00000000..0b761f4e --- /dev/null +++ b/installers/helm/osm/templates/zookeeper/zookeeper-service.yaml @@ -0,0 +1,34 @@ +{{- if .Values.zookeeper.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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: zookeeper + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.zookeeper.service.port }} + targetPort: 2181 + protocol: TCP + selector: + app.kubernetes.io/component: zookeeper + {{- include "osm.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/templates/zookeeper/zookeeper-statefulset.yaml b/installers/helm/osm/templates/zookeeper/zookeeper-statefulset.yaml new file mode 100644 index 00000000..a4ed2ec1 --- /dev/null +++ b/installers/helm/osm/templates/zookeeper/zookeeper-statefulset.yaml @@ -0,0 +1,74 @@ +{{- if .Values.zookeeper.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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/v1 +kind: StatefulSet +metadata: + name: zookeeper + labels: + {{- include "osm.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.zookeeper.replicaCount | default .Values.global.replicaCount }} + serviceName: zookeeper + selector: + matchLabels: + app.kubernetes.io/component: zookeeper + {{- include "osm.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.global.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app.kubernetes.io/component: zookeeper + {{- include "osm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "osm.serviceAccountName" . }} + containers: + - name: zookeeper + securityContext: + # readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + # runAsNonRoot: true + image: wurstmeister/zookeeper:latest + imagePullPolicy: {{ .Values.global.image.pullPolicy }} + ports: + - containerPort: 2181 + protocol: TCP + resources: + limits: + memory: 1024Mi + requests: + memory: 128Mi + {{- with .Values.global.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/values.yaml b/installers/helm/osm/values.yaml index 70e83be8..7b0538e5 100644 --- a/installers/helm/osm/values.yaml +++ b/installers/helm/osm/values.yaml @@ -76,10 +76,8 @@ grafana: kafka: enabled: true - listeners: - client: - protocol: "PLAINTEXT" - fullnameOverride: "kafka" + service: + port: 9092 # replicaCount: 1 keystone: @@ -122,9 +120,12 @@ mon: mysql: enabled: true - image: - tag: "8.1-debian-11" - fullnameOverride: "mysql" + # dbHostPath: "/var/lib/osm/osm" + service: + port: 3306 + # replicaCount: 1 + useOsmSecret: true + # secretName: "ro-db-secret" nbi: enabled: true @@ -213,5 +214,6 @@ webhookTranslator: zookeeper: enabled: true - fullnameOverride: "zookeeper" + service: + port: 2181 # replicaCount: 1 diff --git a/installers/osm_health.sh b/installers/osm_health.sh index 651e9db2..16b74cf5 100755 --- a/installers/osm_health.sh +++ b/installers/osm_health.sh @@ -72,8 +72,8 @@ do # State of Statefulsets STS_STATE=$(kubectl get statefulset -n ${STACK_NAME} --no-headers 2>&1) - STS_READY=$(echo "${STS_STATE}" | awk '$2=="1/1" || $2=="2/2" || $2=="3/3" {printf ("%20s\t%s\t%s\n", $1, $2, $4)}') - STS_NOT_READY=$(echo "${STS_STATE}" | awk '$2!="1/1" && $2!="2/2" && $2!="3/3" {printf ("%20s\t%s\t%s\n", $1, $2, $4)}') + STS_READY=$(echo "${STS_STATE}" | awk '$2=="1/1" || $2=="2/2" {printf ("%20s\t%s\t%s\n", $1, $2, $4)}') + STS_NOT_READY=$(echo "${STS_STATE}" | awk '$2!="1/1" && $2!="2/2" {printf ("%20s\t%s\t%s\n", $1, $2, $4)}') COUNT_STS_READY=$(echo "${STS_READY}" | grep -v -e '^$' | wc -l) COUNT_STS_NOT_READY=$(echo "${STS_NOT_READY}" | grep -v -e '^$' | wc -l)