Merge "[AAF] Use global storage templates for PVC"
authorBorislav Glozman <Borislav.Glozman@amdocs.com>
Wed, 11 Dec 2019 14:25:57 +0000 (14:25 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 11 Dec 2019 14:25:57 +0000 (14:25 +0000)
212 files changed:
.gitignore
kubernetes/aaf/charts/aaf-cass/values.yaml
kubernetes/aaf/charts/aaf-cm/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-cm/values.yaml
kubernetes/aaf/charts/aaf-fs/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-fs/values.yaml
kubernetes/aaf/charts/aaf-gui/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-gui/values.yaml
kubernetes/aaf/charts/aaf-hello/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-hello/values.yaml
kubernetes/aaf/charts/aaf-locate/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-locate/values.yaml
kubernetes/aaf/charts/aaf-oauth/values.yaml
kubernetes/aaf/charts/aaf-service/templates/ingress.yaml [new file with mode: 0644]
kubernetes/aaf/charts/aaf-service/values.yaml
kubernetes/aaf/charts/aaf-sms/charts/aaf-sms-quorumclient/values.yaml
kubernetes/aaf/charts/aaf-sms/charts/aaf-sms-vault/values.yaml
kubernetes/aaf/charts/aaf-sms/values.yaml
kubernetes/aaf/charts/aaf-sshsm/charts/aaf-sshsm-abrmd/values.yaml
kubernetes/aaf/charts/aaf-sshsm/charts/aaf-sshsm-distcenter/values.yaml
kubernetes/aaf/charts/aaf-sshsm/charts/aaf-sshsm-testca/values.yaml
kubernetes/aaf/charts/aaf-sshsm/values.yaml
kubernetes/aai
kubernetes/cds/charts/cds-blueprints-processor/resources/config/application.properties
kubernetes/cds/charts/cds-blueprints-processor/templates/ingress.yaml [new file with mode: 0644]
kubernetes/cds/charts/cds-blueprints-processor/templates/pv.yaml
kubernetes/cds/charts/cds-blueprints-processor/templates/pvc.yaml
kubernetes/cds/charts/cds-blueprints-processor/values.yaml
kubernetes/cds/charts/cds-sdc-listener/resources/config/application.yaml
kubernetes/cds/charts/cds-ui/templates/deployment.yaml
kubernetes/cds/charts/cds-ui/templates/ingress.yaml [new file with mode: 0644]
kubernetes/cds/charts/cds-ui/values.yaml
kubernetes/clamp/charts/clamp-dash-es/templates/pv.yaml
kubernetes/clamp/charts/clamp-dash-es/templates/pvc.yaml
kubernetes/clamp/charts/mariadb/templates/pv.yaml
kubernetes/clamp/charts/mariadb/templates/pvc.yaml
kubernetes/clamp/templates/ingress.yaml [new file with mode: 0644]
kubernetes/clamp/values.yaml
kubernetes/cli/templates/ingress.yaml [new file with mode: 0644]
kubernetes/cli/values.yaml
kubernetes/common/cassandra/templates/backup/cronjob.yaml
kubernetes/common/cassandra/templates/backup/pv.yaml
kubernetes/common/cassandra/templates/backup/pvc.yaml
kubernetes/common/cassandra/templates/pv.yaml
kubernetes/common/cassandra/templates/statefulset.yaml
kubernetes/common/cassandra/values.yaml
kubernetes/common/common/templates/_createPassword.tpl [new file with mode: 0644]
kubernetes/common/common/templates/_ingress.tpl
kubernetes/common/common/templates/_mariadb.tpl [new file with mode: 0644]
kubernetes/common/common/templates/_name.tpl
kubernetes/common/etcd/templates/pv.yaml
kubernetes/common/etcd/templates/statefulset.yaml
kubernetes/common/etcd/values.yaml
kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml
kubernetes/common/mariadb-galera/templates/backup/pv.yaml
kubernetes/common/mariadb-galera/templates/backup/pvc.yaml
kubernetes/common/mariadb-galera/templates/pv.yaml
kubernetes/common/mariadb-galera/templates/statefulset.yaml
kubernetes/common/mariadb-init/.helmignore [moved from kubernetes/common/mysql/.helmignore with 97% similarity]
kubernetes/common/mariadb-init/Chart.yaml [moved from kubernetes/common/nfs-provisioner/Chart.yaml with 84% similarity]
kubernetes/common/mariadb-init/requirements.yaml [moved from kubernetes/common/mysql/requirements.yaml with 89% similarity]
kubernetes/common/mariadb-init/resources/config/db_init.sh [new file with mode: 0755]
kubernetes/common/mariadb-init/templates/_configmap.tpl [moved from kubernetes/common/mongo/templates/storageclass.yaml with 62% similarity]
kubernetes/common/mariadb-init/templates/_mariadb.tpl [moved from kubernetes/common/mysql/Chart.yaml with 56% similarity]
kubernetes/common/mariadb-init/templates/configmap.yaml [moved from kubernetes/common/mysql/templates/secrets.yaml with 80% similarity]
kubernetes/common/mariadb-init/templates/job.yaml [new file with mode: 0644]
kubernetes/common/mariadb-init/templates/secret.yaml [moved from kubernetes/common/mysql/templates/storageclass.yaml with 68% similarity]
kubernetes/common/mariadb-init/tests/configmap_test.yaml [new file with mode: 0644]
kubernetes/common/mariadb-init/tests/job_test.yaml [new file with mode: 0644]
kubernetes/common/mariadb-init/tests/secret_test.yaml [new file with mode: 0644]
kubernetes/common/mariadb-init/values.yaml [new file with mode: 0644]
kubernetes/common/mongo/templates/nfs-provisoner.yaml [deleted file]
kubernetes/common/mongo/templates/pv.yaml
kubernetes/common/mongo/templates/service.yaml
kubernetes/common/mongo/templates/statefulset.yaml
kubernetes/common/mongo/values.yaml
kubernetes/common/music/charts/music-cassandra/templates/pv.yaml [new file with mode: 0644]
kubernetes/common/music/charts/music-cassandra/templates/statefulset.yaml
kubernetes/common/music/charts/music-cassandra/templates/volumes.yaml [deleted file]
kubernetes/common/music/charts/music-cassandra/values.yaml
kubernetes/common/music/charts/zookeeper/templates/pv.yaml [new file with mode: 0644]
kubernetes/common/music/charts/zookeeper/templates/statefulset.yaml
kubernetes/common/music/charts/zookeeper/templates/volumes.yaml [deleted file]
kubernetes/common/music/charts/zookeeper/values.yaml
kubernetes/common/mysql/templates/configmap.yaml [deleted file]
kubernetes/common/mysql/templates/nfs-provisoner.yaml [deleted file]
kubernetes/common/mysql/templates/pv.yaml [deleted file]
kubernetes/common/mysql/templates/service.yaml [deleted file]
kubernetes/common/mysql/templates/statefulset.yaml [deleted file]
kubernetes/common/mysql/values.yaml [deleted file]
kubernetes/common/nfs-provisioner/requirements.yaml [deleted file]
kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml [deleted file]
kubernetes/common/nfs-provisioner/templates/service.yaml [deleted file]
kubernetes/common/nfs-provisioner/values.yaml [deleted file]
kubernetes/common/postgres/templates/pv.yaml
kubernetes/common/postgres/templates/statefulset.yaml
kubernetes/consul/templates/ingress.yaml [new file with mode: 0644]
kubernetes/consul/values.yaml
kubernetes/contrib/charts/awx/charts/awx-postgres/templates/pv.yaml
kubernetes/contrib/charts/awx/charts/awx-postgres/templates/pvc.yaml
kubernetes/contrib/charts/awx/requirements.yaml
kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml
kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml
kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pv.yaml
kubernetes/contrib/charts/netbox/charts/netbox-postgres/templates/pvc.yaml
kubernetes/contrib/ingress-nginx-post-inst/nginx_ingress_cluster_config.yaml [new file with mode: 0644]
kubernetes/dcaegen2/components/dcae-bootstrap/values.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/pv.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/pvc.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml
kubernetes/dcaegen2/components/dcae-redis/templates/ingress.yaml [new file with mode: 0644]
kubernetes/dcaegen2/components/dcae-redis/templates/pv.yaml
kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml
kubernetes/dcaegen2/components/dcae-redis/values.yaml
kubernetes/dmaap/components/dmaap-bc/templates/deployment.yaml
kubernetes/dmaap/components/dmaap-bc/templates/ingress.yaml [new file with mode: 0644]
kubernetes/dmaap/components/dmaap-bc/templates/secrets.yaml [moved from kubernetes/nbi/templates/secrets.yaml with 78% similarity]
kubernetes/dmaap/components/dmaap-bc/values.yaml
kubernetes/dmaap/components/dmaap-dr-node/templates/ingress.yaml [new file with mode: 0644]
kubernetes/dmaap/components/dmaap-dr-node/values.yaml
kubernetes/dmaap/components/dmaap-dr-prov/templates/ingress.yaml [new file with mode: 0644]
kubernetes/dmaap/components/dmaap-dr-prov/values.yaml
kubernetes/log/charts/log-elasticsearch/templates/ingress.yaml [new file with mode: 0644]
kubernetes/log/charts/log-elasticsearch/templates/pv.yaml
kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml
kubernetes/log/charts/log-elasticsearch/values.yaml
kubernetes/log/charts/log-kibana/templates/ingress.yaml [new file with mode: 0644]
kubernetes/log/charts/log-kibana/values.yaml
kubernetes/log/charts/log-logstash/templates/ingress.yaml [new file with mode: 0644]
kubernetes/log/charts/log-logstash/values.yaml
kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml
kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml
kubernetes/msb/charts/msb-consul/templates/ingress.yaml [new file with mode: 0644]
kubernetes/msb/charts/msb-consul/values.yaml
kubernetes/msb/charts/msb-discovery/templates/ingress.yaml [new file with mode: 0644]
kubernetes/msb/charts/msb-discovery/values.yaml
kubernetes/msb/charts/msb-eag/templates/ingress.yaml [new file with mode: 0644]
kubernetes/msb/charts/msb-eag/values.yaml
kubernetes/msb/charts/msb-iag/templates/ingress.yaml [new file with mode: 0644]
kubernetes/msb/charts/msb-iag/values.yaml
kubernetes/multicloud/charts/multicloud-prometheus/charts/prometheus-alertmanager/templates/pv.yaml
kubernetes/multicloud/charts/multicloud-prometheus/charts/prometheus-alertmanager/templates/pvc.yaml
kubernetes/multicloud/charts/multicloud-prometheus/charts/prometheus-grafana/templates/pv.yaml
kubernetes/multicloud/charts/multicloud-prometheus/charts/prometheus-grafana/templates/pvc.yaml
kubernetes/multicloud/charts/multicloud-prometheus/templates/pv.yaml
kubernetes/multicloud/charts/multicloud-prometheus/templates/pvc.yaml
kubernetes/multicloud/charts/multicloud-windriver/templates/pv.yaml
kubernetes/multicloud/charts/multicloud-windriver/templates/pvc.yaml
kubernetes/multicloud/values.yaml
kubernetes/nbi/requirements.yaml
kubernetes/nbi/templates/deployment.yaml
kubernetes/nbi/tests/deployment_test.yaml [new file with mode: 0644]
kubernetes/nbi/values.yaml
kubernetes/onap/requirements.yaml
kubernetes/onap/values.yaml
kubernetes/oof/templates/ingress.yaml [new file with mode: 0644]
kubernetes/oof/values.yaml
kubernetes/pnda/charts/dcae-pnda-bootstrap/templates/job.yaml
kubernetes/pnda/charts/dcae-pnda-bootstrap/templates/pv.yaml
kubernetes/pnda/charts/dcae-pnda-bootstrap/templates/pvc.yaml [moved from kubernetes/common/mongo/templates/pvc.yaml with 78% similarity]
kubernetes/policy/charts/drools/charts/nexus/templates/pv.yaml
kubernetes/policy/charts/drools/charts/nexus/templates/pvc.yaml
kubernetes/pomba/charts/pomba-data-router/templates/ingress.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-data-router/values.yaml
kubernetes/pomba/charts/pomba-kibana/templates/ingress.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-kibana/values.yaml
kubernetes/pomba/charts/pomba-networkdiscovery/templates/ingress.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/values.yaml
kubernetes/portal/charts/portal-app/templates/ingress.yaml [new file with mode: 0644]
kubernetes/portal/charts/portal-app/values.yaml
kubernetes/portal/charts/portal-cassandra/templates/pv.yaml
kubernetes/portal/charts/portal-cassandra/templates/pvc.yaml
kubernetes/portal/charts/portal-mariadb/templates/pv.yaml
kubernetes/portal/charts/portal-mariadb/templates/pvc.yaml
kubernetes/portal/charts/portal-sdk/templates/ingress.yaml [new file with mode: 0644]
kubernetes/portal/charts/portal-sdk/values.yaml
kubernetes/portal/values.yaml
kubernetes/sdc/charts/sdc-be/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdc/charts/sdc-be/values.yaml
kubernetes/sdc/charts/sdc-dcae-dt/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdc/charts/sdc-dcae-dt/values.yaml
kubernetes/sdc/charts/sdc-dcae-fe/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdc/charts/sdc-dcae-fe/values.yaml
kubernetes/sdc/charts/sdc-es/templates/pv.yaml
kubernetes/sdc/charts/sdc-es/templates/pvc.yaml
kubernetes/sdc/charts/sdc-fe/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdc/charts/sdc-fe/values.yaml
kubernetes/sdc/charts/sdc-onboarding-be/templates/pv.yaml
kubernetes/sdc/charts/sdc-onboarding-be/templates/pvc.yaml
kubernetes/sdc/charts/sdc-wfd-be/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdc/charts/sdc-wfd-be/values.yaml
kubernetes/sdc/charts/sdc-wfd-fe/templates/ingress.yaml
kubernetes/sdc/charts/sdc-wfd-fe/values.yaml
kubernetes/sdnc/charts/dmaap-listener/values.yaml
kubernetes/sdnc/charts/sdnc-ansible-server/values.yaml
kubernetes/sdnc/charts/sdnc-portal/values.yaml
kubernetes/sdnc/charts/ueb-listener/values.yaml
kubernetes/sdnc/templates/ingress.yaml [new file with mode: 0644]
kubernetes/sdnc/values.yaml
kubernetes/so/charts/so-mariadb/templates/pv.yaml
kubernetes/so/charts/so-mariadb/templates/pvc.yaml
kubernetes/uui/charts/uui-server/templates/ingress.yaml [new file with mode: 0644]
kubernetes/uui/charts/uui-server/values.yaml
kubernetes/uui/templates/ingress.yaml [new file with mode: 0644]
kubernetes/uui/values.yaml
kubernetes/vfc/charts/vfc-catalog/templates/pv.yaml
kubernetes/vfc/charts/vfc-catalog/templates/pvc.yaml
kubernetes/vid/templates/ingress.yaml [new file with mode: 0644]
kubernetes/vid/values.yaml
kubernetes/vnfsdk/templates/ingress.yaml [new file with mode: 0644]
kubernetes/vnfsdk/values.yaml

index 96e76c1..fcf3cdd 100644 (file)
@@ -1,3 +1,6 @@
+# Unit tests
+__snapshot__
+
 # Application
 kubernetes/config/onap-parameters.yaml
 kubernetes/dist/*
@@ -22,4 +25,3 @@ requirements.lock
 
 # Mac OS
 *DS_Store*
-
index 7e4e5f7..ea8da6e 100644 (file)
@@ -61,23 +61,22 @@ ingress:
   enabled: false
 
 # Configure resource requests and limits
-resources: {}
-  # Following AAI's advice, and not trying to guess on Cass usage.  Guessing just makes it slow
-#  small:
-#    limits:
-#      cpu: "1000m"
-#      memory: 4096Mi
-#    requests:
-#      cpu: 20m
-#      memory: 2048Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 12000Mi
-#    requests:
-#      cpu: 40m
-#      memory: 9000Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 2100m
+     memory: 1792Mi
+   requests:
+     cpu: 30m
+     memory: 1280Mi
+ large:
+   limits:
+     cpu: 4
+     memory: 12000Mi
+   requests:
+     cpu: 40m
+     memory: 9000Mi
+ unlimited: {}
 
 persistence:
   enabled: true
diff --git a/kubernetes/aaf/charts/aaf-cm/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-cm/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index 6ace7d1..2bd05d8 100644 (file)
@@ -52,22 +52,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aafcm"
+      name: "aaf-cm"
+      port: 8150
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 800Mi
-#    requests:
-#      cpu: 20m
-#      memory: 500Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 1Gi
-#    requests:
-#      cpu: 40m
-#      memory: 600Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 20m
+     memory: 300Mi
+   requests:
+     cpu: 1m
+     memory: 200Mi
+ large:
+   limits:
+     cpu: 400m
+     memory: 1Gi
+   requests:
+     cpu: 40m
+     memory: 600Mi
+ unlimited: {}
diff --git a/kubernetes/aaf/charts/aaf-fs/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-fs/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index 48ad7c1..d1a35a7 100644 (file)
@@ -54,22 +54,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aaffs"
+      name: "aaf-fs"
+      port: 8096
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 800Mi
-#    requests:
-#      cpu: 10m
-#      memory: 300Mi
-#  large:
-#    limits:
-#      cpu: 500m
-#      memory: 700Mi
-#    requests:
-#      cpu: 100m
-#      memory: 400Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 200m
+     memory: 110Mi
+   requests:
+     cpu: 1m
+     memory: 80Mi
+ large:
+   limits:
+     cpu: 500m
+     memory: 700Mi
+   requests:
+     cpu: 100m
+     memory: 400Mi
+ unlimited: {}
diff --git a/kubernetes/aaf/charts/aaf-gui/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-gui/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index 3068f14..1f7abd4 100644 (file)
@@ -56,23 +56,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aafgui"
+      name: "aaf-gui"
+      port: 8200
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#resources:
-#  small:
-#    limits:
-#      cpu: 100m
-#      memory: 500Mi
-#    requests:
-#      cpu: 10m
-#      memory: 200Mi
-#  large:
-#    limits:
-#      cpu: 200m
-#      memory: 1Gi
-#    requests:
-#      cpu: 100m
-#      memory: 500Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 20m
+     memory: 280Mi
+   requests:
+     cpu: 1m
+     memory: 170Mi
+ large:
+   limits:
+     cpu: 200m
+     memory: 1Gi
+   requests:
+     cpu: 100m
+     memory: 500Mi
+ unlimited: {}
diff --git a/kubernetes/aaf/charts/aaf-hello/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-hello/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index 0d1521e..36bed9d 100644 (file)
@@ -70,23 +70,27 @@ readiness:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aafhello"
+      name: "aaf-hello"
+      port: 8130
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#resources:
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 500Mi
-#    requests:
-#      cpu: 10m
-#      memory: 200Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 1Gi
-#    requests:
-#      cpu: 20m
-#      memory: 500Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 200m
+     memory: 500Mi
+   requests:
+     cpu: 10m
+     memory: 200Mi
+ large:
+   limits:
+     cpu: 400m
+     memory: 1Gi
+   requests:
+     cpu: 20m
+     memory: 500Mi
+ unlimited: {}
diff --git a/kubernetes/aaf/charts/aaf-locate/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-locate/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index c13f834..ce59d2d 100644 (file)
@@ -52,23 +52,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aaflocate"
+      name: "aaf-locate"
+      port: 8095
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#resources:
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 600Mi
-#    requests:
-#      cpu: 20m
-#      memory: 300Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 1Gi
-#    requests:
-#      cpu: 40m
-#      memory: 500Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 40m
+     memory: 320Mi
+   requests:
+     cpu: 1m
+     memory: 210Mi
+ large:
+   limits:
+     cpu: 400m
+     memory: 1Gi
+   requests:
+     cpu: 40m
+     memory: 500Mi
+ unlimited: {}
index 3c29a62..ef00a46 100644 (file)
@@ -51,23 +51,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aafoauth"
+      name: "aaf-oauth"
+      port: 8140
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#resources:
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 400Mi
-#    requests:
-#      cpu: 20m
-#      memory: 200Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 600Mi
-#    requests:
-#      cpu: 40m
-#      memory: 200Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 40m
+     memory: 320Mi
+   requests:
+     cpu: 1m
+     memory: 210Mi
+ large:
+   limits:
+     cpu: 400m
+     memory: 600Mi
+   requests:
+     cpu: 40m
+     memory: 200Mi
+ unlimited: {}
diff --git a/kubernetes/aaf/charts/aaf-service/templates/ingress.yaml b/kubernetes/aaf/charts/aaf-service/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..40b4bba
--- /dev/null
@@ -0,0 +1,4 @@
+
+{{ include "common.ingress" . }}
+
+
index 8794afe..190b284 100644 (file)
@@ -52,23 +52,27 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "aafservice"
+      name: "aaf-service"
+      port: 8100
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
-resources: {}
-# Allow END users to do this, if they want.  Detrimental to Test services
-#resources:
-#  small:
-#    limits:
-#      cpu: 200m
-#      memory: 800Mi
-#    requests:
-#      cpu: 20m
-#      memory: 300Mi
-#  large:
-#    limits:
-#      cpu: 400m
-#      memory: 1Gi
-#    requests:
-#      cpu: 40m
-#      memory: 300Mi
-#  unlimited: {}
+resources:
+ small:
+   limits:
+     cpu: 250m
+     memory: 360Mi
+   requests:
+     cpu: 10m
+     memory: 250Mi
+ large:
+   limits:
+     cpu: 400m
+     memory: 1Gi
+   requests:
+     cpu: 40m
+     memory: 300Mi
+ unlimited: {}
index 4dc13a5..142fbb5 100644 (file)
@@ -60,10 +60,10 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 40m
+      memory: 40Mi
     requests:
-      cpu: 10m
+      cpu: 1m
       memory: 10Mi
   large:
     limits:
index 360bf42..192d33d 100644 (file)
@@ -96,11 +96,11 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 40m
+      memory: 40Mi
     requests:
       cpu: 10m
-      memory: 10Mi
+      memory: 25Mi
   large:
     limits:
       cpu: 400m
index de005ed..2de7466 100644 (file)
@@ -88,8 +88,8 @@ ingress:
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 100m
+      memory: 15Mi
     requests:
       cpu: 10m
       memory: 10Mi
index 1fcc155..2a73363 100644 (file)
@@ -45,8 +45,8 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 20m
+      memory: 50Mi
     requests:
       cpu: 10m
       memory: 10Mi
index e8d2f7e..94791be 100644 (file)
@@ -54,8 +54,8 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 20m
+      memory: 50Mi
     requests:
       cpu: 10m
       memory: 10Mi
index 5c3618d..3f7782c 100644 (file)
@@ -46,8 +46,8 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 20m
+      memory: 50Mi
     requests:
       cpu: 10m
       memory: 10Mi
index 2d20d57..6d4fbec 100644 (file)
@@ -50,8 +50,8 @@ persistence:
 resources:
   small:
     limits:
-      cpu: 200m
-      memory: 500Mi
+      cpu: 20m
+      memory: 50Mi
     requests:
       cpu: 10m
       memory: 10Mi
index 81954e5..552da2c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 81954e51ef4c04fb08182d779f4871dfca766221
+Subproject commit 552da2c65b6af3f6328fcc6b11af9329d5efa30a
index c17c2f4..2a67aa5 100755 (executable)
@@ -16,7 +16,7 @@
 # Web server config
 ### START -Controller Blueprints Properties
 # Load Resource Source Mappings
-resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability,rest=source-rest,script=source-capability
+resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability,rest=source-rest,vault-data=source-rest,script=source-capability
 
 # Blueprint Processor File Execution and Handling Properties
 blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
@@ -109,9 +109,25 @@ blueprintsprocessor.messageproducer.self-service-api.bootstrapServers=message-ro
 
 
 # Used in Health Check
-endpoints.user.name=ccsdkapps
-endpoints.user.password=ccsdkapps
 blueprintsprocessor.messageproducer.self-service-api.type=kafka-basic-auth
 blueprintsprocessor.messageproducer.self-service-api.clientId=cds-client
 blueprintsprocessor.messageproducer.self-service-api.topic=cds-producer
 
+
+blueprintprocessor.remoteScriptCommand.enabled=true
+
+#Encrypted username and password for health check service
+endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ==
+endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ==
+
+#BaseUrls for health check blueprint processor services
+blueprintprocessor.healthcheck.baseUrl=http://localhost:8080/
+blueprintprocessor.healthcheck.mapping-service-name-with-service-link=[Execution service,/api/v1/execution-service/health-check],[Resources service,/api/v1/resources/health-check],[Template service,/api/v1/template/health-check]
+
+#BaseUrls for health check Cds Listener services
+cdslistener.healthcheck.baseUrl=http://cds-sdc-listener:8080/
+cdslistener.healthcheck.mapping-service-name-with-service-link=[SDC Listener service,/api/v1/sdclistener/healthcheck]
+
+#Actuator properties
+management.endpoints.web.exposure.include=*
+management.endpoint.health.show-details=always
diff --git a/kubernetes/cds/charts/cds-blueprints-processor/templates/ingress.yaml b/kubernetes/cds/charts/cds-blueprints-processor/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 8121087..a4bf83e 100755 (executable)
@@ -15,6 +15,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 {{- if not .Values.persistence.storageClass -}}
 kind: PersistentVolume
 apiVersion: v1
@@ -33,7 +34,9 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 98b5571..601334e 100755 (executable)
@@ -30,21 +30,10 @@ metadata:
 {{ .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-{{- if not .Values.persistence.storageClass }}
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-blueprints
-{{- end }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
 {{- end -}}
index 96fc70c..781b538 100755 (executable)
@@ -96,6 +96,12 @@ persistence:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "blueprintsprocessorhttp"
+      name: "blueprints-processor-http"
+      port: 8080
+  config:
+    ssl: "none"
 
 resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
index 9d03025..cc611a1 100644 (file)
@@ -17,4 +17,27 @@ listenerservice:
     archivePath: /opt/app/onap/sdc-listener/
     grpcAddress: cds-blueprints-processor-grpc
     grpcPort: 9111
-    authHeader: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
\ No newline at end of file
+    authHeader: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
+
+
+cdslistener:
+  healthcheck:
+    baseUrl: http://localhost:9000/
+    mapping-service-name-with-service-link: "[SDC Listener service,/api/v1/sdclistener/healthcheck]"
+
+
+management:
+  endpoint:
+    health:
+      show-details: always
+
+
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+
+endpoints:
+  user:
+    name: eHbVUbJAj4AG2522cSbrOQ==
+    password: eHbVUbJAj4AG2522cSbrOQ==
index 562cd54..bdb1871 100644 (file)
@@ -56,7 +56,7 @@ spec:
               value: {{ .Values.config.api.controller.http.baseUrl }}
             - name: API_BLUEPRINT_CONTROLLER_HTTP_AUTH_TOKEN
               value: {{ .Values.config.api.controller.http.authToken }}
-            - name: API_BLUEPRINT_PROCESSOR_HHTP_BASE_URL
+            - name: API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL
               value: {{ .Values.config.api.processor.http.baseUrl }}
             - name: API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN
               value: {{ .Values.config.api.processor.http.authToken }}
diff --git a/kubernetes/cds/charts/cds-ui/templates/ingress.yaml b/kubernetes/cds/charts/cds-ui/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 8fd2c7a..e4a3e8a 100644 (file)
@@ -85,6 +85,13 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "cdsui"
+      name: "cds-ui"
+      port: 8080
+  config: 
+    ssl: "none"
+
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
index fd21cdf..a1408df 100644 (file)
 # limitations under the License.
 */}}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.fullname" . }}-data
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -30,7 +31,9 @@ spec:
     storage: {{ .Values.persistence.size}}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index abab145..d2eddc2 100644 (file)
@@ -29,11 +29,9 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
index 252ca76..d166900 100644 (file)
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.fullname" . }}-data
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -32,7 +33,9 @@ spec:
     storage: {{ .Values.persistence.size}}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index 1deed4e..c3c2a22 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
 {{- end -}}
diff --git a/kubernetes/clamp/templates/ingress.yaml b/kubernetes/clamp/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 92d4bb7..d66273d 100644 (file)
@@ -83,6 +83,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "clamp"
+      name: "clamp"
+      port: 443
+  config:
+    ssl: "redirect"
 
 #resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
diff --git a/kubernetes/cli/templates/ingress.yaml b/kubernetes/cli/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 0fbe21d..7278c99 100644 (file)
@@ -63,6 +63,15 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "cli"
+      name: "cli"
+      port: 8080
+    - baseaddr: "cli2"
+      name: cli
+      port: 9090
+  config:
+    ssl: "none"
 
 # Configure resource requests and limits
 # ref: http://kubernetes.io/docs/user-guide/compute-resources/
index 630ac43..0d06318 100644 (file)
@@ -75,7 +75,7 @@ spec:
 
                 echo "Executing cleanup!!"
                 command="nodetool cleanup"
-                /root/exec.py -p "cassandra" -c "$command"                
+                /root/exec.py -p "cassandra" -c "$command"
                 echo "Cleaned Node!! Backing up database now!!!"
 
                 command="nodetool snapshot -t $curr_time"
@@ -97,7 +97,7 @@ spec:
                     if [ 1 ] {{- range $t, $keyspace := $root.Values.backup.keyspacesToSkip }} && [ "{{ $keyspace.name }}" != "$keyspace_name" ] {{- end }}; then
                       /root/restore.sh -b $backup_dir/cassandra-{{ $i }}/data -s  /onap-data/cassandra-{{ $i }}/data/$keyspace_name -k $keyspace_name -t $curr_time &
                       pids="$pids $!"
-                    fi                  
+                    fi
                   done
                 {{- end }}
 
@@ -121,7 +121,7 @@ spec:
                   echo "Failed" > /backup/backup.log
                   exit 0
                 fi
-                
+
                 mv /backup/temp /backup/backup-${curr_time}
                 echo "Success" > /backup/backup.log
                 echo "Cassandra Backup Succeeded"
@@ -135,8 +135,10 @@ spec:
               - mountPath: /etc/localtime
                 name: localtime
                 readOnly: true
-              - mountPath: /onap-data
-                name: data-dir
+              {{- range $i := until (int .Values.replicaCount)}}
+              - mountPath: /onap-data/cassandra-{{ $i }}
+                name: data-dir-{{ $i }}
+              {{- end }}
               - mountPath: /backup
                 name: backup-dir
               - name: scripts
@@ -144,7 +146,7 @@ spec:
                 subPath: restore.sh
               - name: scripts
                 mountPath: /root/exec.py
-                subPath: exec.py           
+                subPath: exec.py
           containers:
             - name: cassandra-backup-validate
               image: "{{ .Values.image }}"
@@ -200,7 +202,7 @@ spec:
                   done
                   kill -9 $CASS_PID
                 {{- end }}
-                echo "Validation Successful!!!" 
+                echo "Validation Successful!!!"
                 cd /backup
                 totalFiles=`ls -t | grep "backup-" | wc -l`
                 if [ $totalFiles -gt {{ .Values.backup.retentionPeriod }} ]; then
@@ -230,13 +232,14 @@ spec:
               path: /etc/localtime
           - name: scripts
             configMap:
-              name: {{ include "common.fullname" $ }}-configmap
+              name: {{ include "common.fullname" . }}-configmap
               defaultMode: 0755
-          - name: data-dir
+          {{- range $i := until (int .Values.replicaCount)}}
+          - name: data-dir-{{ $i }}
             persistentVolumeClaim:
-              claimName: {{ include "common.fullname" . }}-db-data
+              claimName: {{ include "common.fullname" . }}-data-{{ $i }}
+          {{- end }}
           - name: backup-dir
             persistentVolumeClaim:
               claimName: {{ include "common.fullname" . }}-backup-data
 {{- end -}}
-              
index 332dc95..10c3100 100644 (file)
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2019 Amdocs, Bell Canada, AT&T
+# Copyright © 2019 Amdocs, Bell Canada, AT&T, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 */}}
 {{- if .Values.backup.enabled }}
-{{ if .Values.persistence.enabled }}
-apiVersion: v1
-kind: PersistentVolume
-metadata:
-  name: {{ include "common.fullname" . }}-db-data
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    heritage: {{ .Release.Service }}
-    name: {{ include "common.fullname" . }}-db-data
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-  - {{ .Values.persistence.accessMode }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 ---
 apiVersion: v1
 kind: PersistentVolume
@@ -49,9 +32,10 @@ spec:
     storage: {{ .Values.persistence.size }}
   accessModes:
   - {{ .Values.persistence.accessMode }}
-  hostPath:
-    path: {{ .Values.global.persistence.backup.mountPath | default .Values.persistence.backup.mountPath }}/{{ include "common.namespace" $ }}/{{ include "common.fullname" $ }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-{{ end }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
+  hostPath:
+    path: {{ .Values.global.persistence.backup.mountPath | default .Values.persistence.backup.mountPath }}/{{ include "common.namespace" . }}/{{ include "common.fullname" . }}
+{{- end -}}
+{{- end -}}
 {{- end -}}
-
index 1f848c3..dd7f381 100644 (file)
 */}}
 {{- if .Values.backup.enabled }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-db-data
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}-backup
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-{{- if .Values.persistence.annotations }}
-  annotations:
-{{ toYaml .Values.persistence.annotations | indent 4 }}
-{{- end }}
-spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-db-data
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  resources:
-    requests:
-      storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 ---
 kind: PersistentVolumeClaim
 apiVersion: v1
@@ -61,20 +31,11 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-backup-data
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
 {{- end -}}
 {{- end -}}
index 06f41e7..fbbb5ba 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{ if .Values.persistence.enabled }}
-{{- $root := . -}}
-{{ range $i, $e := until (int $root.Values.replicaCount) }}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
 ---
 apiVersion: v1
 kind: PersistentVolume
 metadata:
-  name: {{ $root.Release.Name }}-{{ $root.Values.service.name }}-{{ $i }}
-  namespace: {{ $root.Release.Namespace }}
+  name: {{ $global.Release.Name }}-{{ $global.Values.service.name }}-{{ $i }}
+  namespace: {{ $global.Release.Namespace }}
   labels:
-    type: {{ $root.Values.persistence.storageType }}
-    app: {{ $root.Values.service.name }}
-    chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}
-    release: {{ $root.Release.Name }}
-    heritage: {{ $root.Release.Service }}
+    type: {{ $global.Values.persistence.storageType }}
+    app: {{ $global.Values.service.name }}
+    chart: {{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}
+    release: {{ $global.Release.Name }}
+    heritage: {{ $global.Release.Service }}
 spec:
   capacity:
-    storage: {{ $root.Values.persistence.size }}
+    storage: {{ $global.Values.persistence.size }}
   accessModes:
-    - {{ $root.Values.persistence.accessMode }}
+  {{- if $global.Values.backup.enabled }}
+  - ReadWriteMany
+  {{- else }}
+  - ReadWriteOnce
+  {{- end }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ $root.Values.persistence.mountPath }}/{{ $root.Release.Name }}/{{ $root.Values.persistence.mountSubPath }}-{{ $i }}
-  persistentVolumeReclaimPolicy: {{ $root.Values.persistence.volumeReclaimPolicy }}
-{{ end }}
-{{ end }}
+    path: {{ $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{ $i }}
+{{- end -}}
+{{- end -}}
+{{- end -}}
index 4be3570..72e886d 100644 (file)
@@ -49,7 +49,7 @@ spec:
         - containerPort: {{ $ports.port }}
         {{- end }}
         volumeMounts:
-          - name: cassandra-data
+          - name: {{ include "common.fullname" . }}-data
             mountPath: /var/lib/cassandra
           - name: localtime
             mountPath: /etc/localtime
@@ -151,25 +151,26 @@ spec:
           name: {{ include "common.fullname" . }}-entrypoint
           defaultMode: 0755
   {{- if not .Values.persistence.enabled }}
-      - name: cassandra-data
+      - name: {{ include "common.fullname" . }}-data
         emptyDir: {}
   {{- else }}
   volumeClaimTemplates:
     - metadata:
-        name: cassandra-data
+        name: {{ include "common.fullname" . }}-data
         labels:
-          app: {{ template "common.fullname" . }}
+          name: {{ include "common.fullname" . }}
+          chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
           release: "{{ .Release.Name }}"
           heritage: "{{ .Release.Service }}"
-      annotations:
-        volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
       spec:
         accessModes:
-          - {{ .Values.persistence.accessMode | quote }}
+        {{- if .Values.backup.enabled }}
+        - ReadWriteMany
+        {{- else }}
+        - ReadWriteOnce
+        {{- end }}
+        storageClassName: {{ include "common.storageClass" . }}
         resources:
           requests:
             storage: {{ .Values.persistence.size | quote }}
-        selector:
-          matchLabels:
-            release: "{{ .Release.Name }}"
   {{- end }}
index e568996..c3af7e5 100644 (file)
@@ -115,12 +115,12 @@ persistence:
   ##   GKE, AWS & OpenStack)
   ##
   ## storageClass: "-"
-  accessMode: ReadWriteOnce
+  ## Not set as it depends of the backup enabledment or not.
+  #accessMode: ReadWriteOnce
   size: 2Gi
   mountPath: /dockerdata-nfs
   mountSubPath: cassandra
   storageType: local
-  storageClass: ""
   backup:
       mountPath: /dockerdata-nfs/backup
 
diff --git a/kubernetes/common/common/templates/_createPassword.tpl b/kubernetes/common/common/templates/_createPassword.tpl
new file mode 100644 (file)
index 0000000..938b0ee
--- /dev/null
@@ -0,0 +1,62 @@
+{{/*
+# Copyright © 2019 Samsung Electronics
+#
+# 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.
+*/}}
+
+{{/*
+  Resolve the master password to be used to derive other passwords. The value of
+  .Values.masterPassword is used by default, unless either override mechanism is
+  used:
+
+  - .Values.global.masterPassword  : override default master password for all charts
+  - .Values.masterPasswordOverride : override global and default masterPassword on a per chart basis
+*/}}
+{{- define "common.masterPassword" -}}
+  {{ if .Values.masterPasswordOverride }}
+    {{- printf "%d" .Values.masterPasswordOverride -}}
+  {{ else if .Values.global.masterPassword }}
+    {{- printf "%d" .Values.global.masterPassword -}}
+  {{ else if .Values.masterPassword }}
+    {{- printf "%d" .Values.masterPassword -}}
+  {{ else }}
+    {{ fail "masterPassword not provided" }}
+  {{ end }}
+{{- end -}}
+
+{{/*
+  Generate a new password based on masterPassword. The new password is not
+  random, it is derived from masterPassword, fully qualified chart name and
+  additional uid provided by the user. This ensures that every time when we
+  run this function from the same place, with the same password and uid we
+  get the same results. This allows to avoid password changes while you are
+  doing upgrade.
+
+  The function can take from one to three arguments (inside a dictionary):
+  - .dot : environment (.)
+  - .uid : unique identifier of password to be generated within this particular chart. Use only when you create more than a single password within one chart
+  - .strength : complexity of derived password. See derivePassword documentation for more details
+
+  Example calls:
+
+    {{ include "common.createPassword" . }}
+    {{ include "common.createPassword" (dict "dot" . "uid" "mysqlRootPasswd") }}
+
+*/}}
+{{- define "common.createPassword" -}}
+  {{- $dot := default . .dot -}}
+  {{- $uid := default "onap" .uid -}}
+  {{- $strength := default "long" .strength -}}
+  {{- $mp := include "common.masterPassword" $dot -}}
+  {{- derivePassword 1 $strength $mp (include "common.fullname" $dot) $uid -}}
+{{- end -}}
index 49d7eeb..b4afe63 100644 (file)
@@ -1,12 +1,24 @@
 {{- define "ingress.config.port" -}}
 {{- if .Values.ingress -}}
-{{- if .Values.ingress.service -}}
+{{- if or (not .Values.global.ingress.virtualhost) (not .Values.global.ingress.virtualhost.enabled) -}}
+  - http:
+      paths:
 {{- range .Values.ingress.service }}
-        - path: {{ .path }}
+        - path: {{  printf "/%s" (required "baseaddr" .baseaddr) }}
           backend:
             serviceName: {{ .name }}
             servicePort: {{ .port }}
 {{- end -}}
+{{- else if .Values.ingress.service -}}
+{{- $burl := (required "baseurl" .Values.global.ingress.virtualhost.baseurl) -}}
+{{ range .Values.ingress.service }}
+  - host: {{ printf "%s.%s" (required "baseaddr" .baseaddr) $burl }}
+    http:
+      paths:
+      - backend:
+          serviceName: {{ .name }}
+          servicePort: {{ .port }}
+{{- end -}}
 {{- else -}}
         - path: {{ printf "/%s" .Chart.Name }}
           backend:
 {{- end -}}
 
 
+{{- define "ingress.config.annotations.ssl" -}}
+{{- if .Values.ingress.config -}}
+{{- if .Values.ingress.config.ssl -}}
+{{- if eq .Values.ingress.config.ssl "redirect" -}}
+kubernetes.io/ingress.class: nginx
+nginx.ingress.kubernetes.io/ssl-passthrough: "true"
+nginx.ingress.kubernetes.io/ssl-redirect: "true"
+{{-  else if eq .Values.ingress.config.ssl "native" -}}
+nginx.ingress.kubernetes.io/ssl-redirect: "true"
+{{-  else if eq .Values.ingress.config.ssl "none" -}}
+nginx.ingress.kubernetes.io/ssl-redirect: "false"
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+
 {{- define "ingress.config.annotations" -}}
 {{- if .Values.ingress -}}
 {{- if .Values.ingress.annotations -}}
 {{ toYaml .Values.ingress.annotations | indent 4 | trim }}
 {{- end -}}
 {{- end -}}
+{{ include "ingress.config.annotations.ssl" . | indent 4 | trim }}
 {{- end -}}
 
 
 {{- define "common.ingress" -}}
 {{- if .Values.ingress -}}
-{{- if .Values.ingress.enabled -}}
+{{- if .Values.global.ingress -}}
+{{- if and .Values.ingress.enabled .Values.global.ingress.enabled -}}
 apiVersion: extensions/v1beta1
 kind: Ingress
 metadata:
@@ -42,9 +73,7 @@ metadata:
     heritage: {{ .Release.Service }}
 spec:
   rules:
-  - http:
-      paths:
-        {{- include "ingress.config.port" . }}
+  {{ include "ingress.config.port" . | trim }}
 {{- if .Values.ingress.tls }}
   tls:
 {{ toYaml .Values.ingress.tls | indent 4 }}
@@ -52,4 +81,4 @@ spec:
 {{- end -}}
 {{- end -}}
 {{- end -}}
-
+{{- end -}}
\ No newline at end of file
diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl
new file mode 100644 (file)
index 0000000..cd7142f
--- /dev/null
@@ -0,0 +1,59 @@
+{{/*
+# Copyright © 2019 Orange
+#
+# 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.
+*/}}
+
+{{/*
+  Choose the name of the mariadb service to use.
+*/}}
+{{- define "common.mariadbService" -}}
+  {{- if .Values.global.mariadbGalera.localCluster -}}
+    {{- index .Values "mariadb-galera" "service" "name" -}}
+  {{- else -}}
+    {{- .Values.global.mariadbGalera.service -}}
+  {{- end -}}
+{{- end -}}
+
+{{/*
+  Choose the value of mariadb port to use.
+*/}}
+{{- define "common.mariadbPort" -}}
+  {{- if .Values.global.mariadbGalera.localCluster -}}
+    {{- index .Values "mariadb-galera" "service" "internalPort" -}}
+  {{- else -}}
+    {{- .Values.global.mariadbGalera.internalPort -}}
+  {{- end -}}
+{{- end -}}
+
+{{/*
+  Choose the value of secret to retrieve user value.
+*/}}
+{{- define "common.mariadbSecret" -}}
+  {{- if .Values.global.mariadbGalera.localCluster -}}
+    {{ printf "%s-%s" (include "common.fullname" .) (index .Values "mariadb-galera" "nameOverride") -}}
+  {{- else -}}
+    {{ printf "%s-%s" (.Release.Name) (index .Values "mariadb-init" "nameOverride") -}}
+  {{- end -}}
+{{- end -}}
+
+{{/*
+  Choose the value of secret param to retrieve user value.
+*/}}
+{{- define "common.mariadbSecretParam" -}}
+  {{- if .Values.global.mariadbGalera.localCluster -}}
+    {{ printf "user-password" -}}
+  {{- else -}}
+    {{ printf "db-user-password" -}}
+  {{- end -}}
+{{- end -}}
index 4299984..f84ca21 100644 (file)
 {{- define "common.fullname" -}}
   {{- $name := default .Chart.Name .Values.nameOverride -}}
   {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+
+{{/*
+  Retrieve the "original" release from the component release:
+  if ONAP is deploy with "helm deploy --name toto", then cassandra components
+  will have "toto-cassandra" as release name.
+  this function would answer back "toto".
+*/}}
+{{- define "common.release" -}}
+  {{- regexReplaceAll "-[a-zA-Z0-9]*$" .Release.Name ""  }}
+{{- end -}}
index 65993e5..da8dfb8 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{ if .Values.persistence.enabled }}
-{{- $root := . -}}
-{{ range $i, $e := until (int $root.Values.replicaCount) }}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
 ---
 apiVersion: v1
 kind: PersistentVolume
 metadata:
-  name: {{ include "common.fullname" $root }}-data-{{ $i }}
-  namespace: {{ $root.Release.Namespace }}
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    type: {{ $root.Values.persistence.storageType }}
-    app: {{ include "common.fullname" $root }}
-    chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}
-    release: {{ $root.Release.Name }}
-    heritage: {{ $root.Release.Service }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
   capacity:
-    storage: {{ $root.Values.persistence.storage }}
+    storage: {{ $global.Values.persistence.storage }}
   accessModes:
-    - {{ $root.Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" $root }}-data"
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ $root.Values.persistence.mountPath }}/{{ $root.Release.Name }}/{{ $root.Values.persistence.mountSubPath }}-{{ $i }}
-  persistentVolumeReclaimPolicy: {{ $root.Values.persistence.volumeReclaimPolicy }}
-{{ end }}
-{{ end }}
-
+    path: {{ $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{ $i }}
+{{if ne $i (int $global.Values.replicaCount) }}
+---
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
index 7190c5b..cef1a48 100644 (file)
@@ -213,14 +213,19 @@ spec:
   volumeClaimTemplates:
   - metadata:
       name: {{ include "common.fullname" . }}-data
+      labels:
+        name: {{ include "common.fullname" . }}
+        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        release: "{{ .Release.Name }}"
+        heritage: "{{ .Release.Service }}"
     spec:
       accessModes:
-        - "{{ .Values.persistence.accessMode }}"
+      - "{{ .Values.persistence.accessMode }}"
+      storageClassName: {{ include "common.storageClass" . }}
       resources:
         requests:
           # upstream recommended max is 700M
           storage: "{{ .Values.persistence.storage }}"
-      storageClassName: {{ include "common.fullname" . }}-data
   {{- else }}
       volumes:
       - name: {{ include "common.fullname" . }}-data
@@ -231,4 +236,3 @@ spec:
         emptyDir: {}
       {{- end }}
   {{- end }}
-
index 7f53d22..d994f87 100644 (file)
@@ -45,7 +45,7 @@ liveness:
   enabled: true
 
 persistence:
-  enabled: false
+  enabled: true
   ## etcd data Persistent Volume Storage Class
   ## If defined, storageClassName: <storageClass>
   ## If set to "-", storageClassName: "", which disables dynamic provisioning
@@ -79,4 +79,3 @@ tolerations: []
 affinity: {}
 extraEnv: []
 resources: {}
-
index 7d3ec75..a5f1578 100644 (file)
@@ -91,10 +91,8 @@ spec:
                   name: {{ include "common.fullname" . }}
                   key: db-root-password
             volumeMounts:
-            - name: backup-data
+            - name: backup-dir
               mountPath: /backup
-            - name: db-data
-              mountPath: /var/lib/mysql
           containers:
           - name: mariadb-backup-validate
             image: "{{ include "common.repository" . }}/{{ .Values.backupImage }}"
@@ -130,7 +128,7 @@ spec:
                 remove_dir $target_dir
                 exit 0
               fi
-              
+
               /docker-entrypoint.sh mysqld &
 
               count=0
@@ -163,16 +161,13 @@ spec:
             - mountPath: /etc/localtime
               name: localtime
               readOnly: true
-            - name: backup-data
+            - name: backup-dir
               mountPath: /backup
           volumes:
           - name: localtime
             hostPath:
               path: /etc/localtime
-          - name: db-data
-            persistentVolumeClaim:
-              claimName: {{ include "common.fullname" . }}-db-data
-          - name: backup-data
+          - name: backup-dir
             persistentVolumeClaim:
-              claimName: {{ include "common.fullname" . }}-backup 
+              claimName: {{ include "common.fullname" . }}-backup-data
 {{- end }}
index 2972191..ec6f44d 100644 (file)
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2019 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 */}}
 {{- if .Values.backup.enabled }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-backup
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}-backup
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-  - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.backup.mountPath | default .Values.persistence.backup.mountPath }}/{{ include "common.namespace" . }}/{{include "common.name" . }}
+{{- if eq "True" (include "common.needPV" .) -}}
 ---
-kind: PersistentVolume
 apiVersion: v1
+kind: PersistentVolume
 metadata:
-  name: {{ include "common.fullname" . }}-db-data
+  name: {{ include "common.fullname" . }}-backup-data
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}-db-data
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    heritage: {{ .Release.Service }}
+    name: {{ include "common.fullname" . }}-backup-data
 spec:
   capacity:
-    storage: {{ .Values.persistence.size}}
+    storage: {{ .Values.persistence.size }}
   accessModes:
   - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data-backup"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}{{ sub .Values.replicaCount 1 }}
+    path: {{ .Values.global.persistence.backup.mountPath | default .Values.persistence.backup.mountPath }}/{{ include "common.namespace" $ }}/{{ include "common.fullname" $ }}
+{{- end -}}
 {{- end -}}
 {{- end -}}
-
index a983c8a..06b590c 100644 (file)
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2019 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 */}}
 {{- if .Values.backup.enabled }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-backup
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}-backup
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-{{- if .Values.persistence.annotations }}
-  annotations:
-{{ toYaml .Values.persistence.annotations | indent 4 }}
-{{- end }}
-spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-backup
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  resources:
-    requests:
-      storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 ---
 kind: PersistentVolumeClaim
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-db-data
+  name: {{ include "common.fullname" . }}-backup-data
   namespace: {{ include "common.namespace" . }}
   labels:
-    app: {{ include "common.name" . }}-db-data
+    app: {{ include "common.name" . }}-backup
     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
@@ -61,21 +31,15 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-db-data
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
+{{- if eq "True" (include "common.needPV" .) -}}
+  storageClassName: "{{ include "common.fullname" . }}-data-backup"
 {{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
+{{- end -}}
 {{- end -}}
 {{- end -}}
-
index 96bd94e..795ad31 100644 (file)
@@ -20,7 +20,7 @@
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" $global }}-data-{{$i}}
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
   namespace: {{ include "common.namespace" $global }}
   labels:
     app: {{ include "common.fullname" $global }}
index 2e77036..c3cb4aa 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2018 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -112,7 +112,7 @@ spec:
           - mountPath: /var/lib/mysql
             name: {{ include "common.fullname" . }}-data
       initContainers:
-        - name: mariadb-galera-prepare
+        - name: {{ include "common.name" . }}-prepare
           image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
           command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
similarity index 84%
rename from kubernetes/common/nfs-provisioner/Chart.yaml
rename to kubernetes/common/mariadb-init/Chart.yaml
index ad16ed7..47b8b8f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2019 Amdocs, Bell Canada
+# Copyright © 2018 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.
@@ -13,6 +13,6 @@
 # limitations under the License.
 
 apiVersion: v1
-description: NFS provisioner
-name: nfs-provisioner
+description: Chart for MariaDB Galera init job
+name: mariadb-init
 version: 5.0.0
similarity index 89%
rename from kubernetes/common/mysql/requirements.yaml
rename to kubernetes/common/mariadb-init/requirements.yaml
index 79d7de4..d323dda 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2018 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.
@@ -15,4 +15,4 @@
 dependencies:
   - name: common
     version: ~5.x-0
-    repository: '@local'
+    repository: 'file://../common'
\ No newline at end of file
diff --git a/kubernetes/common/mariadb-init/resources/config/db_init.sh b/kubernetes/common/mariadb-init/resources/config/db_init.sh
new file mode 100755 (executable)
index 0000000..304835b
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copyright © 2019 Orange
+#
+# 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.
+
+echo "Creating database {{ .Values.config.mysqlDatabase }} and user {{ .Values.config.userName }}..."
+
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE OR REPLACE USER '{{ .Values.config.userName }}'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}'"
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE DATABASE IF NOT EXISTS {{ .Values.config.mysqlDatabase }}"
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON {{ .Values.config.mysqlDatabase }}.* TO '{{ .Values.config.userName }}'@'%'"
+
+echo "Created database {{ .Values.config.mysqlDatabase }} and user {{ .Values.config.userName }}."
+
+{{ range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases -}}
+echo "Creating database {{ $db }} and user {{ $dbInfos.user }}..."
+
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE OR REPLACE USER '{{ $dbInfos.user }}'@'%' IDENTIFIED BY '${MYSQL_PASSWORD_{{ $db | upper }}}'"
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE DATABASE IF NOT EXISTS {{ $db }}"
+mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON {{ $db }}.* TO '{{ $dbInfos.user }}'@'%'"
+
+echo "Created database {{ $db }} and user {{ $dbInfos.user }}."
+{{ end }}
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2019 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 */}}
 
-{{ if not .Values.disableNfsProvisioner }}
-kind: StorageClass
-apiVersion: storage.k8s.io/v1
-metadata:
-  name: "{{ include "common.fullname" . }}-data"
-  namespace: {{ include "common.namespace" . }}
-provisioner: {{ include "common.fullname" . }}/nfs
-{{ end }}
+{{/*
+  Choose the name of the configmap to use.
+*/}}
+{{- define "mariadbInit.configMap" -}}
+  {{- if (eq "default" .Values.config.config_map) -}}
+    {{- include "common.fullname" . -}}
+  {{- else -}}
+    {{- printf "%s-%s" (include "common.release" .) .Values.config.config_map -}}
+  {{- end -}}
+{{- end -}}
similarity index 56%
rename from kubernetes/common/mysql/Chart.yaml
rename to kubernetes/common/mariadb-init/templates/_mariadb.tpl
index 7f27229..4f111a5 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright © 2017 Amdocs, Bell Canada
+{{/*
+# Copyright © 2019 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # 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
-description: MySQL Server
-name: mysql
-version: 5.0.0
+{{/*
+  Choose the name of the mariadb secret to use.
+*/}}
+{{- define "mariadbInit.mariadbClusterSecret" -}}
+  {{- if (eq "default" .Values.global.mariadbGalera.userRootSecret) -}}
+    {{- printf "%s-mariadb-galera-%s" (include "common.release" .) .Values.global.mariadbGalera.nameOverride -}}
+  {{- else -}}
+    {{- .Values.global.mariadbGalera.userRootSecret -}}
+  {{- end -}}
+{{- end -}}
@@ -1,5 +1,5 @@
-{{/*
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2019 Orange
+# Modifications Copyright © 2018 AT&T
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # 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: Secret
+kind: ConfigMap
 metadata:
   name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
-    app: {{ include "common.fullname" . }}
+    app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
-type: Opaque
 data:
-  db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }}
+{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml
new file mode 100644 (file)
index 0000000..679c10c
--- /dev/null
@@ -0,0 +1,105 @@
+# Copyright © 2019 Orange
+#
+# 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: batch/v1
+kind: Job
+metadata:
+  name: {{ include "common.fullname" . }}-config-job
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  backoffLimit: 20
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.name" . }}
+        release: {{ .Release.Name }}
+      name: {{ include "common.name" . }}
+    spec:
+      initContainers:
+      - name: {{ include "common.name" . }}-readiness
+        command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - {{ .Values.global.mariadbGalera.nameOverride }}
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+      containers:
+      - name: {{ include "common.name" . }}
+        image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        command:
+        - bash
+        - /db_init/db_init.sh
+        env:
+        - name: DB_HOST
+          value: "{{ .Values.global.mariadbGalera.nameOverride }}"
+        - name: DB_PORT
+          value: "{{ .Values.global.mariadbGalera.servicePort }}"
+        - name: MYSQL_ROOT_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: {{ include "mariadbInit.mariadbClusterSecret" . }}
+              key: {{ .Values.global.mariadbGalera.userRootSecretKey }}
+        - name: MYSQL_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: {{ template "common.fullname" . }}
+              key: db-user-password
+{{- $root := . }}
+{{ range $db, $_value := .Values.config.mysqlAdditionalDatabases }}
+        - name: {{ printf "MYSQL_PASSWORD_%s" $db | upper }}
+          valueFrom:
+            secretKeyRef:
+              name: {{ template "common.fullname" $root }}-secret
+              key: {{ printf "db-%s-user-password" $db }}
+{{ end }}
+        volumeMounts:
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
+        - name: mariadb-conf
+          mountPath: /db_init/
+          readOnly: true
+        resources:
+{{ include "common.resources" . | indent 12 }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 10 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 10 }}
+      {{- end }}
+      volumes:
+      - name: mariadb-conf
+        configMap:
+          name: {{ include "mariadbInit.configMap" . }}
+      - name: localtime
+        hostPath:
+          path: /etc/localtime
+      restartPolicy: Never
+      imagePullSecrets:
+      - name: "{{ include "common.namespace" . }}-docker-registry-key"
@@ -1,5 +1,4 @@
-{{/*
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2017 Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # 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.disableNfsProvisioner }}
-kind: StorageClass
-apiVersion: storage.k8s.io/v1
+apiVersion: v1
+kind: Secret
 metadata:
-  name: "{{ include "common.fullname" . }}-mysql"
+  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 }}
-provisioner: {{ include "common.fullname" . }}/nfs
+type: Opaque
+data:
+  db-user-password: {{ index .Values.config.userPassword | b64enc | quote }}
+{{ range $db, $dbInfos := .Values.config.mysqlAdditionalDatabases }}
+  {{ printf "db-%s-user-password" $db}}: {{ $dbInfos.password | b64enc | quote }}
 {{ end }}
diff --git a/kubernetes/common/mariadb-init/tests/configmap_test.yaml b/kubernetes/common/mariadb-init/tests/configmap_test.yaml
new file mode 100644 (file)
index 0000000..34914cd
--- /dev/null
@@ -0,0 +1,114 @@
+---
+suite: test configmap behavior
+templates:
+  - configmap.yaml
+tests:
+  - it: "should render with default value"
+    asserts:
+      - isKind:
+          of: ConfigMap
+      - equal:
+          path: metadata.name
+          value: RELEASE-NAME-mariadb-init
+      - equal:
+          path: metadata.namespace
+          value: NAMESPACE
+      - matchRegex:
+          path: metadata.labels.app
+          pattern: mariadb-init
+      - equal:
+          path: data
+          value:
+            db_init.sh: |
+              #!/bin/sh
+              # Copyright © 2019 Orange
+              #
+              # 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.
+
+              echo "Creating database ynsaUCru6mUNwGal and user u5WZ1GMSIS1wHZF..."
+
+              mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
+              CREATE OR REPLACE USER 'u5WZ1GMSIS1wHZF'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';
+              CREATE OR REPLACE USER 'u5WZ1GMSIS1wHZF'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';
+              CREATE DATABASE IF NOT EXISTS ynsaUCru6mUNwGal;
+              GRANT ALL PRIVILEGES ON ynsaUCru6mUNwGal.* TO 'u5WZ1GMSIS1wHZF'@'%';
+              GRANT ALL PRIVILEGES ON ynsaUCru6mUNwGal.* TO 'u5WZ1GMSIS1wHZF'@'localhost';
+              EOF
+
+              echo "Created database ynsaUCru6mUNwGal and user u5WZ1GMSIS1wHZF."
+  - it: "shoud render with other databases"
+    set:
+      config:
+        userName: testUser
+        mysqlDatabase: testDB
+        mysqlAdditionalDatabases:
+          dbOne:
+            user: one
+            password: pwd1
+          dbTwo:
+            user: two
+            password: pwd2
+    asserts:
+      - equal:
+          path: data
+          value:
+            db_init.sh: |
+              #!/bin/sh
+              # Copyright © 2019 Orange
+              #
+              # 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.
+
+              echo "Creating database testDB and user testUser..."
+
+              mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
+              CREATE OR REPLACE USER 'testUser'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';
+              CREATE OR REPLACE USER 'testUser'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';
+              CREATE DATABASE IF NOT EXISTS testDB;
+              GRANT ALL PRIVILEGES ON testDB.* TO 'testUser'@'%';
+              GRANT ALL PRIVILEGES ON testDB.* TO 'testUser'@'localhost';
+              EOF
+
+              echo "Created database testDB and user testUser."
+
+              echo "Creating database dbOne and user one..."
+
+              mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
+              CREATE OR REPLACE USER 'one'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD_DBONE}';
+              CREATE OR REPLACE USER 'one'@'%' IDENTIFIED BY '${MYSQL_PASSWORD_DBONE}';
+              CREATE DATABASE IF NOT EXISTS dbOne;
+              GRANT ALL PRIVILEGES ON dbOne.* TO 'one'@'%';
+              GRANT ALL PRIVILEGES ON dbOne.* TO 'one'@'localhost';
+              EOF
+
+              echo "Created database dbOne and user one."
+              echo "Creating database dbTwo and user two..."
+
+              mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
+              CREATE OR REPLACE USER 'two'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD_DBTWO}';
+              CREATE OR REPLACE USER 'two'@'%' IDENTIFIED BY '${MYSQL_PASSWORD_DBTWO}';
+              CREATE DATABASE IF NOT EXISTS dbTwo;
+              GRANT ALL PRIVILEGES ON dbTwo.* TO 'two'@'%';
+              GRANT ALL PRIVILEGES ON dbTwo.* TO 'two'@'localhost';
+              EOF
+
+              echo "Created database dbTwo and user two."
diff --git a/kubernetes/common/mariadb-init/tests/job_test.yaml b/kubernetes/common/mariadb-init/tests/job_test.yaml
new file mode 100644 (file)
index 0000000..7523ee1
--- /dev/null
@@ -0,0 +1,307 @@
+---
+suite: test job behavior
+templates:
+  - job.yaml
+tests:
+  - it: "should render with default value (global)"
+    asserts:
+      - isKind:
+          of: Job
+      - matchRegex:
+          path: metadata.name
+          pattern: -mariadb-init-config-job$
+      - equal:
+          path: metadata.namespace
+          value: NAMESPACE
+      - matchRegex:
+          path: metadata.labels.app
+          pattern: mariadb-init
+      - matchRegex:
+          path: spec.template.metadata.labels.app
+          pattern: mariadb-init
+      - matchRegex:
+          path: spec.template.metadata.name
+          pattern: mariadb-init
+      - isNull:
+          path: spec.template.spec.nodeSelector
+      - isNull:
+          path: spec.template.spec.affinity
+  - it: "should render with default value (init container)"
+    asserts:
+      - matchRegex:
+          path: spec.template.spec.initContainers[0].name
+          pattern: mariadb-init-readiness
+      - contains:
+          path: spec.template.spec.initContainers[0].args
+          content: mariadb-galera
+      - equal:
+          path: spec.template.spec.initContainers[0].image
+          value: oomk8s/readiness-check:2.0.2
+      - equal:
+          path: spec.template.spec.initContainers[0].imagePullPolicy
+          value: IfNotPresent
+  - it: "should render with default value (container)"
+    asserts:
+      - matchRegex:
+          path: spec.template.spec.containers[0].name
+          pattern: mariadb-init
+      - equal:
+          path: spec.template.spec.containers[0].image
+          value: nexus3.onap.org:10001/mariadb:10.1.38
+      - equal:
+          path: spec.template.spec.containers[0].imagePullPolicy
+          value: IfNotPresent
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_HOST
+            value: mariadb-galera
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_PORT
+            value: "3306"
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_ROOT_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-galera-mariadb-galera
+                key: db-root-password
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-init-secret
+                key: db-user-password
+      - contains:
+          path: spec.template.spec.containers[0].volumeMounts
+          content:
+            name: mariadb-conf
+            mountPath: /db_init/
+            readOnly: true
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.cpu
+          value: 100m
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.memory
+          value: 500Mbi
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.cpu
+          value: 10m
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.memory
+          value: 10Mbi
+  - it: "should render with default value (volumes)"
+    asserts:
+      - contains:
+            path: spec.template.spec.volumes
+            content:
+              name: mariadb-conf
+              configMap:
+                name: RELEASE-NAME-mariadb-init
+
+  - it: "should render with nameOverride set"
+    set:
+      nameOverride: myJob
+    asserts:
+      - matchRegex:
+          path: metadata.name
+          pattern: -myJob-config-job$
+      - matchRegex:
+          path: metadata.labels.app
+          pattern: myJob
+      - matchRegex:
+          path: spec.template.metadata.labels.app
+          pattern: myJob
+      - matchRegex:
+          path: spec.template.metadata.name
+          pattern: myJob
+      - matchRegex:
+          path: spec.template.spec.initContainers[0].name
+          pattern: myJob-readiness
+      - matchRegex:
+          path: spec.template.spec.containers[0].name
+          pattern: myJob
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                # replicating name from mariadb galera cluster, kind of hardcoded...
+                name: RELEASE-NAME-myJob-secret
+                key: db-user-password
+      - contains:
+            path: spec.template.spec.volumes
+            content:
+              name: mariadb-conf
+              configMap:
+                name: RELEASE-NAME-myJob
+
+  - it: "should render with configmap set"
+    set:
+      config:
+        config_map: myCM
+    asserts:
+      - contains:
+          path: spec.template.spec.volumes
+          content:
+            name: mariadb-conf
+            configMap:
+              name: RELEASE-NAME-myCM
+
+  - it: "should render with mariadbGalera changes"
+    set:
+      global:
+        mariadbGalera:
+            nameOverride: myMaria
+            servicePort: 545
+    asserts:
+      - contains:
+          path: spec.template.spec.initContainers[0].args
+          content: myMaria
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_HOST
+            value: myMaria
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_PORT
+            value: "545"
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_ROOT_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-galera-myMaria
+                key: db-root-password
+
+  - it: "should render with full mariadbGalera changes"
+    set:
+      global:
+        mariadbGalera:
+            nameOverride: myMaria
+            servicePort: 545
+            userRootSecret: galera-secret
+            userRootSecretKey: root-password
+    asserts:
+      - contains:
+          path: spec.template.spec.initContainers[0].args
+          content: myMaria
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_HOST
+            value: myMaria
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DB_PORT
+            value: "545"
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_ROOT_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: galera-secret
+                key: root-password
+
+  - it: "should set the right nodeSelector"
+    set:
+      nodeSelector:
+        disktype: ssd
+    asserts:
+      - equal:
+          path: spec.template.spec.nodeSelector.disktype
+          value: ssd
+
+  - it: "should set the right affinity"
+    set:
+      affinity:
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+              - matchExpressions:
+                - key: kubernetes.io/e2e-az-name
+                  operator: In
+                  values:
+                    - e2e-az1
+                    - e2e-az2
+    asserts:
+      - equal:
+          path: spec.template.spec.affinity
+          value:
+            nodeAffinity:
+              requiredDuringSchedulingIgnoredDuringExecution:
+                nodeSelectorTerms:
+                  - matchExpressions:
+                    - key: kubernetes.io/e2e-az-name
+                      operator: In
+                      values:
+                        - e2e-az1
+                        - e2e-az2
+  - it: "should use large flavor"
+    set:
+      flavor: large
+    asserts:
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.cpu
+          value: 200m
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.memory
+          value: 500Mbi
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.cpu
+          value: 20m
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.memory
+          value: 20Mbi
+  - it: "should use unlimited flavor"
+    set:
+      flavor: unlimited
+    asserts:
+      - isEmpty:
+          path: spec.template.spec.containers[0].resources
+  - it: "shoud render with other databases"
+    set:
+      config:
+        mysqlAdditionalDatabases:
+          dbOne:
+            user: one
+            password: pwd1
+          dbTwo:
+            user: two
+            password: pwd2
+    asserts:
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-init-secret
+                key: db-user-password
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_PASSWORD_DBONE
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-init-secret
+                key: db-dbOne-user-password
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MYSQL_PASSWORD_DBTWO
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-mariadb-init-secret
+                key: db-dbTwo-user-password
diff --git a/kubernetes/common/mariadb-init/tests/secret_test.yaml b/kubernetes/common/mariadb-init/tests/secret_test.yaml
new file mode 100644 (file)
index 0000000..ef0565d
--- /dev/null
@@ -0,0 +1,49 @@
+---
+suite: test secret behavior
+templates:
+  - secret.yaml
+tests:
+  - it: "should render with default values"
+    asserts:
+      - isKind:
+          of: Secret
+      - equal:
+          path: metadata.name
+          value: RELEASE-NAME-mariadb-init
+      - equal:
+          path: metadata.namespace
+          value: NAMESPACE
+      - matchRegex:
+          path: metadata.labels.app
+          pattern: mariadb-init-config-job
+      - equal:
+          path: data.db-user-password
+          value: Q2lAc2hzT2QzcGt5MVZqaQ==
+  - it: "should render specific password value base64 encoded"
+    set:
+      config:
+        userPassword: yolo
+    asserts:
+      - equal:
+          path: data.db-user-password
+          value: eW9sbw==
+  - it: "shoud render with other databases"
+    set:
+      config:
+        mysqlAdditionalDatabases:
+          dbOne:
+            user: one
+            password: pwd1
+          dbTwo:
+            user: two
+            password: pwd2
+    asserts:
+      - equal:
+          path: data.db-user-password
+          value: Q2lAc2hzT2QzcGt5MVZqaQ==
+      - equal:
+          path: data.db-dbOne-user-password
+          value: cHdkMQ==
+      - equal:
+          path: data.db-dbTwo-user-password
+          value: cHdkMg==
diff --git a/kubernetes/common/mariadb-init/values.yaml b/kubernetes/common/mariadb-init/values.yaml
new file mode 100644 (file)
index 0000000..095ff62
--- /dev/null
@@ -0,0 +1,87 @@
+# Copyright © 2018 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:
+  repository: nexus3.onap.org:10001
+  readinessRepository: oomk8s
+  readinessImage: readiness-check:2.0.2
+  mariadbGalera:
+    nameOverride: mariadb-galera
+    servicePort: 3306
+    # set these two values if you want to access an 'out of ONAP' mariadb
+    userRootSecret: default
+    userRootSecretKey: db-root-password
+
+#################################################################
+# Application configuration defaults.
+#################################################################
+
+image: mariadb:10.1.38
+pullPolicy: IfNotPresent
+
+# Set it if you want to change the name of the different components
+# nameOverride:
+
+config:
+  userPassword: Ci@shsOd3pky1Vji
+  userName: u5WZ1GMSIS1wHZF
+  mysqlDatabase: ynsaUCru6mUNwGal
+  mysqlAdditionalDatabases: {}
+  # add addtional dabases
+  # this is an dict
+  # Example:
+  # mysqlAdditionalDatabases:
+  #   dbOne:
+  #     user: one
+  #     password: pwd1
+  #   dbTwo:
+  #     user: two
+  #     password: pwd2
+  config_map: default
+
+nodeSelector: {}
+
+affinity: {}
+
+#resources: {}
+  # We usually recommend not to specify default resources and to leave this as a conscious
+  # choice for the user. This also increases chances charts run on environments with little
+  # resources, such as Minikube. If you do want to specify resources, uncomment the following
+  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+  #
+  # Example:
+  # Configure resource requests and limits
+  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
+  # Minimum memory for development is 2 CPU cores and 4GB memory
+  # Minimum memory for production is 4 CPU cores and 8GB memory
+flavor: small
+resources:
+  small:
+    limits:
+      cpu: 100m
+      memory: 500Mi
+    requests:
+      cpu: 10m
+      memory: 10Mi
+  large:
+    limits:
+      cpu: 200m
+      memory: 500Mi
+    requests:
+      cpu: 20m
+      memory: 20Mi
+  unlimited: {}
diff --git a/kubernetes/common/mongo/templates/nfs-provisoner.yaml b/kubernetes/common/mongo/templates/nfs-provisoner.yaml
deleted file mode 100644 (file)
index 355ad38..0000000
+++ /dev/null
@@ -1,78 +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.disableNfsProvisioner }}
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  #replicas: {{ .Values.replicaCount }}
-  strategy:
-    type: Recreate
-  template:
-    metadata:
-      labels:
-        app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-        release: {{ .Release.Name }}
-    spec:
-      containers:
-        - name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-          image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          ports:
-            - name: nfs
-              containerPort: {{ .Values.service.nfsPort }}
-            - name: mountd
-              containerPort: {{ .Values.service.mountdPort }}
-            - name: rpcbind
-              containerPort: {{ .Values.service.rpcbindPort }}
-            - name: rpcbind-udp
-              containerPort: {{ .Values.service.rpcbindUdpPort }}
-              protocol: UDP
-          securityContext:
-            capabilities:
-              add:
-                - DAC_READ_SEARCH
-                - SYS_RESOURCE
-          args:
-            - "-provisioner={{ include "common.fullname" . }}/nfs"
-          env:
-            - name: POD_IP
-              valueFrom:
-                fieldRef:
-                  fieldPath: status.podIP
-            - name: SERVICE_NAME
-              value: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-            - name: POD_NAMESPACE
-              valueFrom:
-                fieldRef:
-                  fieldPath: metadata.namespace
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-            - name: export-volume
-              mountPath: /export
-      volumes:
-        - name: export-volume
-          hostPath:
-            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{ end }}
index 824dcbb..edc50ae 100644 (file)
 # limitations under the License.
 */}}
 
-{{- if (and (and (.Values.persistence.enabled) (not .Values.persistence.existingClaim)) ( .Values.disableNfsProvisioner)) -}}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-data
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
   capacity:
-    storage: {{ .Values.persistence.size}}
+    storage: {{ $global.Values.persistence.size}}
   accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
+---
+{{- end -}}
+{{- end -}}
+{{- end -}}
 {{- end -}}
index df55854..d59243f 100644 (file)
@@ -32,29 +32,6 @@ spec:
     app: {{ include "common.name" . }}
     release: {{ .Release.Name }}
   clusterIP: None
-#{{ if not .Values.disableNfsProvisioner }}
----
-kind: Service
-apiVersion: v1
-metadata:
-  name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-spec:
-  ports:
-    - name: nfs
-      port: {{ .Values.service.nfsPort }}
-    - name: mountd
-      port: {{ .Values.service.mountdPort }}
-    - name: rpcbind
-      port: {{ .Values.service.rpcbindPort }}
-    - name: rpcbind-udp
-      port: {{ .Values.service.rpcbindUdpPort }}
-      protocol: UDP
-  selector:
-    app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-#{{ end }}
 ---
 # Client service for connecting to any Mongo instance for reads.
 apiVersion: v1
index c79739f..0c6c9f4 100644 (file)
@@ -33,24 +33,6 @@ spec:
         app: {{ include "common.name" . }}
         release: {{ .Release.Name }}
     spec:
-      initContainers:
-#{{ if not .Values.disableNfsProvisioner }}
-      - name: {{ include "common.name" . }}-readiness
-        command:
-        - /root/ready.py
-        args:
-        - --container-name
-        - {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-#{{ end }}
-
       containers:
         - name: {{ include "common.name" . }}
           image: "{{ .Values.dockerHubRepository }}/{{ .Values.image }}"
@@ -79,8 +61,8 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           volumeMounts:
-          - mountPath: /var/lib/mongo
-            name: {{ include "common.fullname" . }}-data
+          - name: {{ include "common.fullname" . }}-data
+            mountPath: /var/lib/mongo
           resources:
 {{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
@@ -95,10 +77,24 @@ spec:
       - name: localtime
         hostPath:
           path: /etc/localtime
+  {{- if .Values.persistence.enabled }}
+  volumeClaimTemplates:
+  - metadata:
+      name: {{ include "common.fullname" . }}-data
+      labels:
+        name: {{ include "common.fullname" . }}
+        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        release: "{{ .Release.Name }}"
+        heritage: "{{ .Release.Service }}"
+    spec:
+      accessModes:
+      - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.storageClass" . }}
+      resources:
+        requests:
+          storage: {{ .Values.persistence.size | quote }}
+  {{- else }}
+      volumes:
       - name: {{ include "common.fullname" . }}-data
-#{{ if .Values.persistence.enabled }}
-        persistentVolumeClaim:
-          claimName: {{ include "common.fullname" . }}-data
-#{{ else }}
         emptyDir: {}
-#{{ end }}
+  {{- end }}
index 8a68129..3c04b42 100644 (file)
@@ -40,8 +40,6 @@ nodeSelector: {}
 
 affinity: {}
 
-disableNfsProvisioner: true
-
 # probe configuration parameters
 liveness:
   initialDelaySeconds: 30
@@ -108,11 +106,6 @@ resources: {}
 #    cpu: 2
 #    memory: 4Gi
 
-
-nfsprovisionerRepository: quay.io
-nfsprovisionerImage: kubernetes_incubator/nfs-provisioner:v1.0.8
-nfsprovisionerPrefix: mongo
-
 sdnctlPrefix: mongo
 
 geoEnabled: false
diff --git a/kubernetes/common/music/charts/music-cassandra/templates/pv.yaml b/kubernetes/common/music/charts/music-cassandra/templates/pv.yaml
new file mode 100644 (file)
index 0000000..fb81540
--- /dev/null
@@ -0,0 +1,46 @@
+{{/*
+# Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
+#
+# 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 := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
+  namespace: {{ include "common.namespace" $global }}
+  labels:
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
+spec:
+  capacity:
+    storage: {{ $global.Values.persistence.size}}
+  accessModes:
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
+  hostPath:
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
+---
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
index 514bccc..c3c56f2 100644 (file)
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
+# Copyright © 2019 AT&T, Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -102,40 +102,33 @@ spec:
             valueFrom:
               fieldRef:
                 fieldPath: status.podIP
+{{- if .Values.persistence.enabled }}
         volumeMounts:
-          - name: {{ template "common.name" . }}-data
+          - name: {{ include "common.fullname" . }}-data
             mountPath: /var/lib/cassandra
+{{- end }}
         resources:
 {{ include "common.resources" . | indent 12 }}
       volumes:
       - name: localtime
         hostPath:
           path: /etc/localtime
-  {{- if not .Values.persistence.enabled }}
-      - name: {{ template "common.name" . }}-data
-        emptyDir: {}
-  {{- else }}
+{{- if .Values.persistence.enabled }}
   volumeClaimTemplates:
-    - metadata:
-        name: {{ template "common.name" . }}-data
-        labels:
-          app: {{ template "common.fullname" . }}
-          chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-          release: "{{ .Release.Name }}"
-          heritage: "{{ .Release.Service }}"
-      annotations:
-        volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
-      spec:
-        storageClassName: {{ .Values.persistence.storageClass }}
-        accessModes:
-          - {{ .Values.persistence.accessMode | quote }}
-        resources:
-          requests:
-            storage: {{ .Values.persistence.size | quote }}
-        selector:
-          matchLabels:
-            app: {{ include "common.name" . }}
-            release: "{{ .Release.Name }}"
-  {{- end }}
+  - metadata:
+      name: {{ include "common.fullname" . }}-data
+      labels:
+        name: {{ include "common.fullname" . }}
+        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        release: "{{ .Release.Name }}"
+        heritage: "{{ .Release.Service }}"
+    spec:
+      accessModes:
+      - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.storageClass" . }}
+      resources:
+        requests:
+          storage: {{ .Values.persistence.size | quote }}
+{{- end }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/common/music/charts/music-cassandra/templates/volumes.yaml b/kubernetes/common/music/charts/music-cassandra/templates/volumes.yaml
deleted file mode 100644 (file)
index 83e7e18..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-{{/*
-# Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
-#
-# 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 .Values.persistence.enabled }}
-{{- $root := . -}}
-{{ range $i, $e := until (atoi (quote $root.Values.replicaCount) | default 3) }}
----
-apiVersion: v1
-kind: PersistentVolume
-metadata:
-  name: {{ $root.Release.Name }}-{{ $root.Values.service.name }}-{{ $i }}
-  namespace: {{ $root.Release.Namespace }}
-  labels:
-    type: {{ $root.Values.persistence.storageType }}
-    app: {{ $root.Values.service.name }}
-    chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}
-    release: {{ $root.Release.Name }}
-    heritage: {{ $root.Release.Service }}
-spec:
-  capacity:
-    storage: {{ $root.Values.persistence.size }}
-  accessModes:
-    - {{ $root.Values.persistence.accessMode }}
-  hostPath:
-    path: {{ $root.Values.persistence.mountPath }}/{{ $root.Release.Name }}/{{ $root.Values.persistence.mountSubPath }}-{{$i}}
-  persistentVolumeReclaimPolicy: {{ $root.Values.persistence.volumeReclaimPolicy }}
-  podAntiAffinity:
-    preferredDuringSchedulingIgnoredDuringExecution:
-    - weight: 1
-      podAffinityTerm:
-        labelSelector:
-          matchExpressions:
-            - key: app
-              operator: In
-              values:
-              - "{{ $root.Chart.Name }}"
-        topologyKey: kubernetes.io/hostname
-{{ end }}
-{{ end }}
index f0888c1..460671d 100644 (file)
@@ -107,8 +107,6 @@ persistence:
   size: 2Gi
   mountPath: /dockerdata-nfs/
   mountSubPath: common/cassandra/data
-  storageType: local
-  storageClass: ""
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/common/music/charts/zookeeper/templates/pv.yaml b/kubernetes/common/music/charts/zookeeper/templates/pv.yaml
new file mode 100644 (file)
index 0000000..795ad31
--- /dev/null
@@ -0,0 +1,45 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada, Orange
+#
+# 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 := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
+  namespace: {{ include "common.namespace" $global }}
+  labels:
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
+spec:
+  capacity:
+    storage: {{ $global.Values.persistence.size}}
+  accessModes:
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
+  hostPath:
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
+---
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
index 9e3549f..580042d 100644 (file)
@@ -82,7 +82,7 @@ spec:
           resources:
 {{ include "common.resources" . }}
           volumeMounts:
-            - name: zookeeper-data
+            - name: {{ include "common.fullname" . }}-data
               mountPath: /var/lib/zookeeper
 
 {{- if .Values.exporters.jmx.enabled }}
@@ -162,30 +162,21 @@ spec:
           configMap:
             name: {{ .Release.Name }}-jmx-exporter
         {{- end }}
-        {{- if not .Values.persistence.enabled }}
-        - name: zookeeper-data
-          emptyDir: {}
-        {{- end }}
       {{- end }}
   {{- if .Values.persistence.enabled }}
   volumeClaimTemplates:
-    - metadata:
-        name: zookeeper-data
-        labels:
-          app: {{ .Chart.Name }}
-          chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-          release: "{{ .Release.Name }}"
-          heritage: "{{ .Release.Service }}"
-      annotations:
-        volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
-      spec:
-        storageClassName: {{ .Values.persistence.storageClass }}
-        accessModes:
-          - {{ .Values.persistence.accessMode | quote }}
-        resources:
-          requests:
-            storage: {{ .Values.persistence.size | quote }}
-        selector:
-          matchLabels:
-            release: "{{ .Release.Name }}"
+  - metadata:
+      name: {{ include "common.fullname" . }}-data
+      labels:
+        name: {{ include "common.fullname" . }}
+        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        release: "{{ .Release.Name }}"
+        heritage: "{{ .Release.Service }}"
+    spec:
+      accessModes:
+      - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.storageClass" . }}
+      resources:
+        requests:
+          storage: {{ .Values.persistence.size | quote }}
   {{- end }}
diff --git a/kubernetes/common/music/charts/zookeeper/templates/volumes.yaml b/kubernetes/common/music/charts/zookeeper/templates/volumes.yaml
deleted file mode 100644 (file)
index b0c05fd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{{ if .Values.persistence.enabled }}
-{{- $root := . -}}
-{{ range $i, $e := until (atoi (quote $root.Values.replicaCount) | default 3) }}
----
-apiVersion: v1
-kind: PersistentVolume
-metadata:
-  name: {{ $root.Release.Name }}-{{ $root.Values.service.name }}-{{ $i }}
-  namespace: {{ $root.Release.Namespace }}
-  labels:
-    type: {{ $root.Values.persistence.storageType }}
-    app: {{ $root.Values.service.name }}
-    chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}
-    release: {{ $root.Release.Name }}
-    heritage: {{ $root.Release.Service }}
-spec:
-  capacity:
-    storage: {{ $root.Values.persistence.size }}
-  accessModes:
-    - {{ $root.Values.persistence.accessMode }}
-  hostPath:
-    path: {{ $root.Values.persistence.mountPath }}/{{ $root.Release.Name }}/{{ $root.Values.persistence.mountSubPath }}-{{$i}}
-  persistentVolumeReclaimPolicy: {{ $root.Values.persistence.volumeReclaimPolicy }}
-{{ end }}
-{{ end }}
index 550dbf2..28c9711 100644 (file)
@@ -119,8 +119,6 @@ persistence:
   accessMode: ReadWriteOnce
   mountPath: /dockerdata-nfs
   mountSubPath: music/zookeeper
-  storageType: local
-  storageClass: ""
   size: 4Gi
 
 ## Exporters query apps for metrics and make those metrics available for
diff --git a/kubernetes/common/mysql/templates/configmap.yaml b/kubernetes/common/mysql/templates/configmap.yaml
deleted file mode 100644 (file)
index 65ac5f2..0000000
+++ /dev/null
@@ -1,41 +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.
-*/}}
-
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.fullname" . }}-db-configmap
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-data:
-  master.cnf: |
-    # Apply this config only on the master.
-    [mysqld]
-    sql_mode = "NO_ENGINE_SUBSTITUTION"
-    log-bin
-    [localpathprefix]
-    master
-  slave.cnf: |
-    # Apply this config only on slaves.
-    [mysqld]
-    sql_mode = "NO_ENGINE_SUBSTITUTION"
-    super-read-only
-    [localpathprefix]
-    slave
diff --git a/kubernetes/common/mysql/templates/nfs-provisoner.yaml b/kubernetes/common/mysql/templates/nfs-provisoner.yaml
deleted file mode 100644 (file)
index 355ad38..0000000
+++ /dev/null
@@ -1,78 +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.disableNfsProvisioner }}
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  #replicas: {{ .Values.replicaCount }}
-  strategy:
-    type: Recreate
-  template:
-    metadata:
-      labels:
-        app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-        release: {{ .Release.Name }}
-    spec:
-      containers:
-        - name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-          image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          ports:
-            - name: nfs
-              containerPort: {{ .Values.service.nfsPort }}
-            - name: mountd
-              containerPort: {{ .Values.service.mountdPort }}
-            - name: rpcbind
-              containerPort: {{ .Values.service.rpcbindPort }}
-            - name: rpcbind-udp
-              containerPort: {{ .Values.service.rpcbindUdpPort }}
-              protocol: UDP
-          securityContext:
-            capabilities:
-              add:
-                - DAC_READ_SEARCH
-                - SYS_RESOURCE
-          args:
-            - "-provisioner={{ include "common.fullname" . }}/nfs"
-          env:
-            - name: POD_IP
-              valueFrom:
-                fieldRef:
-                  fieldPath: status.podIP
-            - name: SERVICE_NAME
-              value: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-            - name: POD_NAMESPACE
-              valueFrom:
-                fieldRef:
-                  fieldPath: metadata.namespace
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-            - name: export-volume
-              mountPath: /export
-      volumes:
-        - name: export-volume
-          hostPath:
-            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{ end }}
diff --git a/kubernetes/common/mysql/templates/pv.yaml b/kubernetes/common/mysql/templates/pv.yaml
deleted file mode 100644 (file)
index 3bef651..0000000
+++ /dev/null
@@ -1,62 +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 (and (and (.Values.persistence.enabled) (not .Values.persistence.existingClaim)) ( .Values.disableNfsProvisioner)) -}}
-{{ $pvNum := default 1 .Values.replicaCount | int }}
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-mysql0
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-mysql"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
-{{ if gt $pvNum 1 }}
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-mysql1
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-mysql"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}1
-{{ end }}
-{{- end -}}
diff --git a/kubernetes/common/mysql/templates/service.yaml b/kubernetes/common/mysql/templates/service.yaml
deleted file mode 100644 (file)
index e1771c6..0000000
+++ /dev/null
@@ -1,146 +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.
-*/}}
-
-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:
-  ports:
-    - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.portName }}
-  selector:
-    app: {{ include "common.name" . }}
-    release: {{ .Release.Name }}
-  clusterIP: None
-#{{ if not .Values.disableNfsProvisioner }}
----
-kind: Service
-apiVersion: v1
-metadata:
-  name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-    - name: nfs
-      port: {{ .Values.service.nfsPort }}
-    - name: mountd
-      port: {{ .Values.service.mountdPort }}
-    - name: rpcbind
-      port: {{ .Values.service.rpcbindPort }}
-    - name: rpcbind-udp
-      port: {{ .Values.service.rpcbindUdpPort }}
-      protocol: UDP
-  selector:
-    app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-#{{ end }}
----
-# Client service for connecting to any MySQL instance for reads.
-# Only master: sdnc-dbhost-0 accepts the write request.
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ include "common.servicename" . }}-read
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-    - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.portName }}
-  selector:
-    app: {{ include "common.name" . }}
-    release: {{ .Release.Name }}
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ .Values.sdnctlPrefix }}-sdnctldb01
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-    - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.portName }}
-  selector:
-    app: {{ include "common.name" . }}
-    release: {{ .Release.Name }}
-  clusterIP: None
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ .Values.sdnctlPrefix }}-sdnctldb02
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-    - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.portName }}
-  selector:
-    app: {{ include "common.name" . }}
-    release: {{ .Release.Name }}
-  clusterIP: None
----
-{{ if .Values.geoEnabled }}
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ include "common.servicename" . }}-nodeport
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-  - name: {{ .Values.service.portName | default .Values.service.name }}-1
-    port: {{ .Values.service.internalPort }}
-    targetPort: {{ .Values.service.internalPort }}
-    nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodeport1 }}
-  - name: {{ .Values.service.portName | default .Values.service.name }}-2
-    port: {{ .Values.xtrabackup.internalPort }}
-    targetPort: {{ .Values.xtrabackup.internalPort }}
-    nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodeport2 }}
-  type:  {{ .Values.service.type }}
-  selector:
-    statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
-    release: {{ .Release.Name }}
-{{ end }}
diff --git a/kubernetes/common/mysql/templates/statefulset.yaml b/kubernetes/common/mysql/templates/statefulset.yaml
deleted file mode 100644 (file)
index c3f8ae2..0000000
+++ /dev/null
@@ -1,263 +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.
-*/}}
-
-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: {{ .Values.service.name }}
-  replicas: {{ .Values.replicaCount }}
-  template:
-    metadata:
-      labels:
-        app: {{ include "common.name" . }}
-        chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-        release: {{ .Release.Name }}
-        heritage: {{ .Release.Service }}
-    spec:
-      initContainers:
-#{{ if not .Values.disableNfsProvisioner }}
-      - name: {{ include "common.name" . }}-readiness
-        command:
-        - /root/ready.py
-        args:
-        - --container-name
-        - {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
-        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-#{{ end }}
-      - name: init-mysql
-        image: "{{ .Values.dockerHubRepository }}/{{ .Values.image }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        command:
-        - bash
-        - "-c"
-        - |
-          set -ex
-          # Generate mysql server-id from pod ordinal index.
-          [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
-          ordinal=${BASH_REMATCH[1]}
-          siteId={{ .Values.geoSiteId }}
-          echo BASH_REMATCH=${BASH_REMATCH}
-          echo [mysqld] > /mnt/conf.d/server-id.cnf
-          # Add an offset to avoid reserved server-id=0 value.
-          echo server-id=$(($siteId*100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
-          # Copy appropriate conf.d files from config-map to emptyDir.
-          if [[ $ordinal -eq 0 ]]; then
-            cp /mnt/config-map/master.cnf /mnt/conf.d/
-          else
-            cp /mnt/config-map/slave.cnf /mnt/conf.d/
-          fi
-        volumeMounts:
-        - name: conf
-          mountPath: /mnt/conf.d
-        - name: config-map
-          mountPath: /mnt/config-map
-
-      - name: clone-mysql
-        image: "{{ .Values.global.xtrabackupRepository | default .Values.xtrabackupRepository }}/{{ .Values.xtrabackupImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        env:
-          - name: MYSQL_ROOT_PASSWORD
-            valueFrom:
-              secretKeyRef:
-                name: {{ template "common.fullname" . }}
-                key: db-root-password
-        command:
-        - bash
-        - "-c"
-        - |
-          set -ex
-          # Skip the clone if data already exists.
-          [[ -d /var/lib/mysql/mysql ]] && exit 0
-          # Skip the clone on master (ordinal index 0).
-          [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
-          ordinal=${BASH_REMATCH[1]}
-          echo ${BASH_REMATCH}
-          [[ $ordinal -eq 0 ]] && exit 0
-          # Clone data from previous peer.
-          ncat --recv-only {{ include "common.fullname" . }}-$(($ordinal-1)).{{ .Values.service.name }}.{{ include "common.namespace" . }} 3307 | xbstream -x -C {{ .Values.persistence.mysqlPath }}
-          # Prepare the backup.
-          xtrabackup --user=root --password=$MYSQL_ROOT_PASSWORD --prepare --target-dir=/var/lib/mysql
-          ls -l {{ .Values.persistence.mysqlPath }}
-        volumeMounts:
-        - name: {{ include "common.fullname" . }}-mysql
-          mountPath: {{ .Values.persistence.mysqlPath }}
-        - name: conf
-          mountPath: /etc/mysql/conf.d
-
-      containers:
-        - name: {{ include "common.name" . }}
-          image: "{{ .Values.dockerHubRepository }}/{{ .Values.image }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          ports:
-          - containerPort: {{ .Values.service.internalPort }}
-          # disable liveness probe when breakpoints set in debugger
-          # so K8s doesn't restart unresponsive container
-          {{- if eq .Values.liveness.enabled true }}
-          livenessProbe:
-            exec:
-              command: ["mysqladmin", "ping"]
-            initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
-            periodSeconds: {{ .Values.liveness.periodSeconds }}
-            timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
-          {{end -}}
-          readinessProbe:
-            tcpSocket:
-              port: {{ .Values.service.internalPort }}
-            initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
-            periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
-            - name: MYSQL_ROOT_PASSWORD
-              valueFrom:
-                secretKeyRef:
-                  name: {{ template "common.fullname" . }}
-                  key: db-root-password
-            - name: MYSQL_ROOT_HOST
-              value: '%'
-            - name: MYSQL_ALLOW_EMPTY_PASSWORD
-              value: {{ .Values.config.dbAllowEmptyPassword | default "0" | quote }}
-          volumeMounts:
-          - mountPath: {{ .Values.persistence.mysqlPath }}
-            name: {{ include "common.fullname" . }}-mysql
-          - mountPath: /etc/mysql/conf.d
-            name: conf
-          resources:
-{{ include "common.resources" . | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
-
-        - name: xtrabackup
-          image: "{{ .Values.global.xtrabackupRepository | default .Values.xtrabackupRepository }}/{{ .Values.xtrabackupImage }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          env:
-            - name: MYSQL_ROOT_PASSWORD
-              valueFrom:
-                secretKeyRef:
-                  name: {{ template "common.fullname" . }}
-                  key: db-root-password
-          ports:
-          - containerPort: {{ .Values.xtrabackup.internalPort }}
-            name: xtrabackup
-          command:
-          - bash
-          - "-c"
-          - |
-            set -ex
-            cd {{ .Values.persistence.mysqlPath }}
-            ls -l
-            # Determine binlog position of cloned data, if any.
-            if [[ -f xtrabackup_slave_info ]]; then
-              echo "Inside xtrabackup_slave_info"
-              # XtraBackup already generated a partial "CHANGE MASTER TO" query
-              # because we're cloning from an existing slave.
-              mv xtrabackup_slave_info change_master_to.sql.in
-              # Ignore xtrabackup_binlog_info in this case (it's useless).
-              rm -f xtrabackup_binlog_info
-            elif [[ -f xtrabackup_binlog_info ]]; then
-              echo "Inside xtrabackup_binlog_info"
-              # We're cloning directly from master. Parse binlog position.
-              [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
-              rm xtrabackup_binlog_info
-              echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
-                    MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
-            fi
-
-            [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
-            ordinal=${BASH_REMATCH[1]}
-            echo $ordinal
-
-            mysqlhost={{ include "common.fullname" . }}-$(($ordinal)).{{ .Values.service.name }}.{{ include "common.namespace" . }}
-            echo $mysqlhost
-
-            # Check if we need to complete a clone by starting replication.
-            if [[ -f change_master_to.sql.in ]]; then
-              echo "Waiting for mysqld to be ready (accepting connections)"
-              until mysql --user=root --password=$MYSQL_ROOT_PASSWORD -h $mysqlhost -e "SELECT 1"; do sleep 1; done
-
-              echo "Initializing replication from clone position"
-              # In case of container restart, attempt this at-most-once.
-              mv change_master_to.sql.in change_master_to.sql.orig
-              mysql --user=root --password=$MYSQL_ROOT_PASSWORD -h $mysqlhost <<EOF
-            $(<change_master_to.sql.orig),
-              MASTER_HOST="{{ include "common.fullname" . }}-0.{{ .Values.service.name }}.{{ include "common.namespace" . }}",
-              MASTER_USER="root",
-              MASTER_PASSWORD="$MYSQL_ROOT_PASSWORD",
-              MASTER_CONNECT_RETRY=10;
-            START SLAVE;
-            EOF
-            fi
-
-            # Start a server to send backups when requested by peers.
-            exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
-              "xtrabackup --user=root --password=$MYSQL_ROOT_PASSWORD --backup --slave-info --stream=xbstream --host=$mysqlhost"
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-mysql
-            mountPath: {{ .Values.persistence.mysqlPath }}
-          - name: conf
-            mountPath: /etc/mysql/conf.d
-      volumes:
-      - name: conf
-        emptyDir: {}
-      - name: config-map
-        configMap:
-          name: {{ include "common.fullname" . }}-db-configmap
-      - name: localtime
-        hostPath:
-          path: /etc/localtime
-      - name: {{ include "common.fullname" . }}-mysql
-  {{ if not .Values.persistence.enabled }}
-      - name: {{ include "common.fullname" . }}-mysql
-        emptyDir: {}
-  {{ else }}
-  volumeClaimTemplates:
-  - metadata:
-      name: {{ include "common.fullname" . }}-mysql
-      labels:
-        app: {{ include "common.name" . }}
-        chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-        release: {{ .Release.Name }}
-        heritage: {{ .Release.Service }}
-        name: {{ include "common.fullname" . }}
-    spec:
-      accessModes: [ {{ .Values.persistence.accessMode }} ]
-      storageClassName: {{ include "common.fullname" . }}-mysql
-      resources:
-        requests:
-          storage: {{ .Values.persistence.size }}
-      selector:
-        matchLabels:
-          name: {{ include "common.fullname" . }}
-  {{ end }}
diff --git a/kubernetes/common/mysql/values.yaml b/kubernetes/common/mysql/values.yaml
deleted file mode 100644 (file)
index 9fd67fc..0000000
+++ /dev/null
@@ -1,133 +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.
-
-#################################################################
-# Global configuration defaults.
-#################################################################
-global:
-  nodePortPrefix: 302
-  persistence: {}
-  readinessRepository: oomk8s
-  readinessImage: readiness-check:2.0.0
-
-
-#################################################################
-# Application configuration defaults.
-#################################################################
-
-dockerHubRepository: registry.hub.docker.com
-image: library/mysql:5.7
-pullPolicy: Always
-
-# application configuration
-config:
-  dbRootPassword: openECOMP1.0
-
-# default number of instances
-replicaCount: 1
-
-nodeSelector: {}
-
-affinity: {}
-
-disableNfsProvisioner: true
-
-# probe configuration parameters
-liveness:
-  initialDelaySeconds: 30
-  periodSeconds: 10
-  timeoutSeconds: 5
-  # necessary to disable liveness probe when setting breakpoints
-  # in debugger so K8s doesn't restart unresponsive container
-  enabled: true
-
-readiness:
-  initialDelaySeconds: 5
-  periodSeconds: 10
-
-## Persist data to a persitent volume
-persistence:
-  enabled: true
-
-  ## A manually managed Persistent Volume and Claim
-  ## Requires persistence.enabled: true
-  ## If defined, PVC must be created manually before volume will be bound
-  # existingClaim:
-  volumeReclaimPolicy: Retain
-
-  ## database data Persistent Volume Storage Class
-  ## If defined, storageClassName: <storageClass>
-  ## If set to "-", storageClassName: "", which disables dynamic provisioning
-  ## If undefined (the default) or set to null, no storageClassName spec is
-  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
-  ##   GKE, AWS & OpenStack)
-  accessMode: ReadWriteOnce
-  size: 1Gi
-  mountPath: /dockerdata-nfs
-  mountSubPath: "mysql/data"
-  mysqlPath: /var/lib/mysql
-
-service:
-  name: mysql
-  portName: mysql
-  internalPort: 3306
-  # nfs provisioner ports
-  nfsPort: 2049
-  mountdPort: 20048
-  rpcbindPort: 111
-  rpcbindUdpPort: 111
-  type: NodePort
-  nodeport1: 72
-  nodeport2: 73
-
-ingress:
-  enabled: false
-
-resources: {}
-  # We usually recommend not to specify default resources and to leave this as a conscious
-  # choice for the user. This also increases chances charts run on environments with little
-  # resources, such as Minikube. If you do want to specify resources, uncomment the following
-  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
-  #
-  # Example:
-  # Configure resource requests and limits
-  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
-  # Minimum memory for development is 2 CPU cores and 4GB memory
-  # Minimum memory for production is 4 CPU cores and 8GB memory
-#resources:
-#  limits:
-#    cpu: 2
-#    memory: 4Gi
-#  requests:
-#    cpu: 2
-#    memory: 4Gi
-
-#################################################################
-# Sidecar Configuration.
-#
-# xtrabackup configuration defaults.
-#################################################################
-xtrabackupRepository: gcr.io/google-samples
-xtrabackupImage: xtrabackup:1.0
-xtrabackup:
-  internalPort: 3307
-
-nfsprovisionerRepository: quay.io
-nfsprovisionerImage: kubernetes_incubator/nfs-provisioner:v1.0.8
-nfsprovisionerPrefix: mysql
-
-sdnctlPrefix: mysql
-
-geoEnabled: false
-geoSiteId: 1
diff --git a/kubernetes/common/nfs-provisioner/requirements.yaml b/kubernetes/common/nfs-provisioner/requirements.yaml
deleted file mode 100644 (file)
index 542c262..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright © 2019 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: ~5.x-0
-    repository: '@local'
diff --git a/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml b/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml
deleted file mode 100644 (file)
index 58cf7a3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-{{/*
-# Copyright © 2019 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: extensions/v1beta1
-kind: Deployment
-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:
-  strategy:
-    type: Recreate
-  template:
-    metadata:
-      labels:
-        app: {{ include "common.fullname" . }}
-        release: {{ .Release.Name }}
-    spec:
-      containers:
-        - name: {{ include "common.fullname" . }}
-          image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          ports:
-            - name: nfs
-              containerPort: {{ .Values.service.nfsPort }}
-            - name: mountd
-              containerPort: {{ .Values.service.mountdPort }}
-            - name: rpcbind
-              containerPort: {{ .Values.service.rpcbindPort }}
-            - name: rpcbind-udp
-              containerPort: {{ .Values.service.rpcbindUdpPort }}
-              protocol: UDP
-          securityContext:
-            capabilities:
-              add:
-                - DAC_READ_SEARCH
-                - SYS_RESOURCE
-          args:
-            - "-provisioner={{ include "common.namespace" . }}/nfs"
-          env:
-            - name: POD_IP
-              valueFrom:
-                fieldRef:
-                  fieldPath: status.podIP
-            - name: SERVICE_NAME
-              value: {{ include "common.servicename" . }}
-            - name: POD_NAMESPACE
-              valueFrom:
-                fieldRef:
-                  fieldPath: metadata.namespace
-          volumeMounts:
-            - name: export-volume
-              mountPath: /export
-      {{- if .Values.affinity }}
-      affinity:
-      {{ toYaml .Values.affinity | indent 8 }}
-      {{- end }}
-      volumes:
-        - name: export-volume
-          hostPath:
-            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}
diff --git a/kubernetes/common/nfs-provisioner/templates/service.yaml b/kubernetes/common/nfs-provisioner/templates/service.yaml
deleted file mode 100644 (file)
index f9bba0f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-{{/*
-# Copyright © 2019 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.
-*/}}
-
-kind: Service
-apiVersion: v1
-metadata:
-  name: {{ include "common.servicename" . }}
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  ports:
-    - name: nfs
-      port: {{ .Values.service.nfsPort }}
-    - name: mountd
-      port: {{ .Values.service.mountdPort }}
-    - name: rpcbind
-      port: {{ .Values.service.rpcbindPort }}
-    - name: rpcbind-udp
-      port: {{ .Values.service.rpcbindUdpPort }}
-      protocol: UDP
-  selector:
-    app: {{ include "common.fullname" . }}
\ No newline at end of file
diff --git a/kubernetes/common/nfs-provisioner/values.yaml b/kubernetes/common/nfs-provisioner/values.yaml
deleted file mode 100644 (file)
index 687219d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright © 2019 Amdocs, Bell Canada\r
-#\r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-#\r
-#       http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-\r
-#################################################################\r
-# Global configuration defaults.\r
-#################################################################\r
-global:\r
-  persistence:\r
-    mountPath: /dockerdata-nfs\r
-\r
-#################################################################\r
-# Application configuration defaults.\r
-#################################################################\r
-\r
-dockerHubRepository: registry.hub.docker.com\r
-pullPolicy: Always\r
-\r
-# default number of instances\r
-\r
-nodeSelector: {}\r
-\r
-affinity: {}\r
-\r
-service:\r
-  name: nfs-provisioner\r
-  nfsPort: 2049\r
-  mountdPort: 20048\r
-  rpcbindPort: 111\r
-  rpcbindUdpPort: 111\r
-\r
-## Persist data to a persitent volume\r
-persistence:\r
-  enabled: true\r
-  mountPath: /dockerdata-nfs\r
-\r
-## NFS provisioner image properties\r
-nfsprovisionerRepository: quay.io\r
-nfsprovisionerImage: kubernetes_incubator/nfs-provisioner:v1.0.8\r
-\r
index 144a3f7..bcd67d7 100644 (file)
 # # See the License for the specific language governing permissions and
 # # limitations under the License.
 */}}
-{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) -}}
+{{- range $i := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-data0
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.fullname" $global }}-data-{{ $i }}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
   capacity:
-    storage: {{ .Values.persistence.size}}
+    storage: {{ $global.Values.persistence.size}}
   accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
 ---
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-data1
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}1
+{{- end -}}
+{{- end -}}
+{{- end -}}
 {{- end -}}
index db4a256..7c38d1d 100644 (file)
@@ -37,23 +37,13 @@ spec:
         - /bin/sh
         - -c
         - |
-          for i in $(seq 0 $(({{ .Values.replicaCount }}-1))); do
-            if [ ! -d /podroot/data$i ]; then
-              mkdir -p /podroot/data$i;
-              chown 26:26 /podroot/data$i;
-              chmod 700 /podroot/data$i;
-            fi;
-          done
-        env:
-        - name: POD_NAME
-          valueFrom: { fieldRef: { fieldPath: metadata.name } }
-        securityContext:
-          privileged: true
+          chown -R 26:26 /podroot/;
+          chmod 700 /podroot/;
         image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: init-sysctl
+        name: {{ include "common.name" . }}-prepare
         volumeMounts:
-        - name: {{ include "common.fullname" . }}-init
+        - name: {{ include "common.fullname" . }}-data
           mountPath: /podroot/
       containers:
       - name: {{ include "common.name" . }}
@@ -129,27 +119,25 @@ spec:
       - name: localtime
         hostPath:
           path: /etc/localtime
-      - name: {{ include "common.fullname" . }}-init
-        hostPath:
-          path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountInitPath }}
       - name: {{ include "common.fullname" . }}-backup
         emptyDir: {}
-#{{ if not .Values.persistence.enabled }}
+{{- if not .Values.persistence.enabled }}
       - name: {{ include "common.fullname" . }}-data
         emptyDir: {}
-#{{ else }}
+{{- else }}
   volumeClaimTemplates:
   - metadata:
       name: {{ include "common.fullname" . }}-data
       labels:
         name: {{ include "common.fullname" . }}
+        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+        release: "{{ .Release.Name }}"
+        heritage: "{{ .Release.Service }}"
     spec:
-      accessModes: [ {{ .Values.persistence.accessMode }} ]
-      storageClassName: {{ include "common.fullname" . }}-data
+      accessModes:
+      - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.storageClass" . }}
       resources:
         requests:
-          storage: {{ .Values.persistence.size }}
-      selector:
-        matchLabels:
-          name: {{ include "common.fullname" . }}
-#{{ end }}
+          storage: {{ .Values.persistence.size | quote }}
+{{- end }}
diff --git a/kubernetes/consul/templates/ingress.yaml b/kubernetes/consul/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 93fd650..d55ea46 100644 (file)
@@ -60,7 +60,13 @@ service: {}
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "consul-server"
+      name: "consul-server"
+      port: 8800
+  config:
+    ssl: "none"
+    
 resources: {}
 
 odl:
index a8cf9f6..da68e34 100755 (executable)
@@ -15,7 +15,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-{{- if not .Values.persistence.storageClass -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,7 +33,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index 52891ff..6d51a09 100755 (executable)
@@ -30,21 +30,10 @@ metadata:
 {{ .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-{{- if not .Values.persistence.storageClass }}
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
-{{- end }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
index 486fc65..ca8971c 100755 (executable)
@@ -14,5 +14,5 @@
 
 dependencies:
   - name: common
-    version: ~4.x-0
+    version: ~5.x-0
     repository: '@local'
\ No newline at end of file
index f741cba..d2783cc 100755 (executable)
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }}
+  name: {{ include "common.fullname" . }}-data
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
     chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
-    name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }}
+    name: {{ include "common.fullname" . }}
 spec:
   capacity:
     storage: {{ .Values.persistence.size}}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/app
 {{- end -}}
index 3489049..a72d827 100755 (executable)
@@ -30,21 +30,10 @@ metadata:
 {{ .Values.persistence.annotations | indent 4 }}
   {{- end }}
 spec:
-{{- if not .Values.persistence.storageClass }}
-  selector:
-    matchLabels:
-      name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }}
-{{- end }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-  {{- if .Values.persistence.storageClass }}
-    {{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-    {{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-    {{- end }}
-  {{- end }}
-{{- end -}}
\ No newline at end of file
+  storageClassName: {{ include "common.storageClass" . }}
+{{- end -}}
index a19f500..9b6ee1b 100755 (executable)
@@ -15,7 +15,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-{{- if not .Values.persistence.storageClass -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,7 +33,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index 30bba6d..022a0fa 100755 (executable)
@@ -30,21 +30,10 @@ metadata:
 {{ .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-{{- if not .Values.persistence.storageClass }}
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
-{{- end }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
+  storageClassName: {{ include "common.storageClass" . }}
 {{- end -}}
diff --git a/kubernetes/contrib/ingress-nginx-post-inst/nginx_ingress_cluster_config.yaml b/kubernetes/contrib/ingress-nginx-post-inst/nginx_ingress_cluster_config.yaml
new file mode 100644 (file)
index 0000000..937828a
--- /dev/null
@@ -0,0 +1,317 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+
+kind: ConfigMap
+apiVersion: v1
+metadata:
+  name: nginx-configuration
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+  name: tcp-services
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+  name: udp-services
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: nginx-ingress-serviceaccount
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRole
+metadata:
+  name: nginx-ingress-clusterrole
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - configmaps
+      - endpoints
+      - nodes
+      - pods
+      - secrets
+    verbs:
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - nodes
+    verbs:
+      - get
+  - apiGroups:
+      - ""
+    resources:
+      - services
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - events
+    verbs:
+      - create
+      - patch
+  - apiGroups:
+      - "extensions"
+      - "networking.k8s.io"
+    resources:
+      - ingresses
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - "extensions"
+      - "networking.k8s.io"
+    resources:
+      - ingresses/status
+    verbs:
+      - update
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: Role
+metadata:
+  name: nginx-ingress-role
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - configmaps
+      - pods
+      - secrets
+      - namespaces
+    verbs:
+      - get
+  - apiGroups:
+      - ""
+    resources:
+      - configmaps
+    resourceNames:
+      # Defaults to "<election-id>-<ingress-class>"
+      # Here: "<ingress-controller-leader>-<nginx>"
+      # This has to be adapted if you change either parameter
+      # when launching the nginx-ingress-controller.
+      - "ingress-controller-leader-nginx"
+    verbs:
+      - get
+      - update
+  - apiGroups:
+      - ""
+    resources:
+      - configmaps
+    verbs:
+      - create
+  - apiGroups:
+      - ""
+    resources:
+      - endpoints
+    verbs:
+      - get
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: RoleBinding
+metadata:
+  name: nginx-ingress-role-nisa-binding
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: Role
+  name: nginx-ingress-role
+subjects:
+  - kind: ServiceAccount
+    name: nginx-ingress-serviceaccount
+    namespace: ingress-nginx
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRoleBinding
+metadata:
+  name: nginx-ingress-clusterrole-nisa-binding
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: nginx-ingress-clusterrole
+subjects:
+  - kind: ServiceAccount
+    name: nginx-ingress-serviceaccount
+    namespace: ingress-nginx
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: nginx-ingress-controller
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app.kubernetes.io/name: ingress-nginx
+      app.kubernetes.io/part-of: ingress-nginx
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/name: ingress-nginx
+        app.kubernetes.io/part-of: ingress-nginx
+      annotations:
+        prometheus.io/port: "10254"
+        prometheus.io/scrape: "true"
+    spec:
+      serviceAccountName: nginx-ingress-serviceaccount
+      containers:
+        - name: nginx-ingress-controller
+          image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.25.1
+          args:
+            - /nginx-ingress-controller
+            - --configmap=$(POD_NAMESPACE)/nginx-configuration
+            - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
+            - --udp-services-configmap=$(POD_NAMESPACE)/udp-services
+            - --publish-service=$(POD_NAMESPACE)/ingress-nginx
+            - --annotations-prefix=nginx.ingress.kubernetes.io
+            - --enable-ssl-passthrough=true
+          securityContext:
+            allowPrivilegeEscalation: true
+            capabilities:
+              drop:
+                - ALL
+              add:
+                - NET_BIND_SERVICE
+            # www-data -> 33
+            runAsUser: 33
+          env:
+            - name: POD_NAME
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.name
+            - name: POD_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+          ports:
+            - name: http
+              containerPort: 80
+            - name: https
+              containerPort: 443
+          livenessProbe:
+            failureThreshold: 3
+            httpGet:
+              path: /healthz
+              port: 10254
+              scheme: HTTP
+            initialDelaySeconds: 10
+            periodSeconds: 10
+            successThreshold: 1
+            timeoutSeconds: 10
+          readinessProbe:
+            failureThreshold: 3
+            httpGet:
+              path: /healthz
+              port: 10254
+              scheme: HTTP
+            periodSeconds: 10
+            successThreshold: 1
+            timeoutSeconds: 10
+
+---
+kind: Service
+apiVersion: v1
+metadata:
+  name: ingress-nginx
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+spec:
+  externalTrafficPolicy: Local
+  type: LoadBalancer
+  selector:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+  ports:
+    - name: http
+      port: 80
+      targetPort: http
+    - name: https
+      port: 443
+      targetPort: https
+
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: ingress-nginx
+  namespace: ingress-nginx
+  labels:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+spec:
+  type: NodePort
+  ports:
+    - name: http
+      port: 80
+      targetPort: 80
+      protocol: TCP
+    - name: https
+      port: 443
+      targetPort: 443
+      protocol: TCP
+  selector:
+    app.kubernetes.io/name: ingress-nginx
+    app.kubernetes.io/part-of: ingress-nginx
+
+---
+
index 00a285b..3ecdff7 100644 (file)
@@ -106,7 +106,7 @@ componentImages:
   tca: onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.1.2
   ves: onap/org.onap.dcaegen2.collectors.ves.vescollector:1.4.5
   snmptrap: onap/org.onap.dcaegen2.collectors.snmptrap:1.4.0
-  prh: onap/org.onap.dcaegen2.services.prh.prh-app-server:1.3.1
+  prh: onap/org.onap.dcaegen2.services.prh.prh-app-server:1.3.2
   hv_ves: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.3.0
 
 # Resource Limit flavor -By Default using small
index b3e90a2..2fd9a6d 100644 (file)
@@ -129,8 +129,12 @@ spec:
           hostPath:
             path: /etc/localtime
         - name: cm-persistent
+        {{- if .Values.persistence.enabled }}
           persistentVolumeClaim:
             claimName: {{ include "common.fullname" . }}-data
+        {{- else }}
+          emptyDir: {}
+        {{- end }}
         - emptyDir: {}
           name: tls-info
       imagePullSecrets:
index bef681a..b454b5a 100644 (file)
@@ -16,6 +16,8 @@
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
+{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) }}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -28,10 +30,13 @@ metadata:
     heritage: "{{ .Release.Service }}"
     name: {{ include "common.fullname" . }}
 spec:
-  storageClassName: manual
   capacity:
     storage: {{ .Values.persistence.size }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
+{{- end -}}
+{{- end -}}
index 6740082..c4de971 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
+{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
 kind: PersistentVolumeClaim
 apiVersion: v1
 metadata:
@@ -22,12 +23,10 @@ metadata:
     name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
 spec:
-  storageClassName: manual
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
\ No newline at end of file
+{{- end -}}
index d8db056..60fd7e5 100644 (file)
@@ -105,3 +105,4 @@ persistence:
   size: 4Gi
   mountPath: /dockerdata-nfs
   mountSubPath: dcae-cm/data
+  volumeReclaimPolicy: Retain
diff --git a/kubernetes/dcaegen2/components/dcae-redis/templates/ingress.yaml b/kubernetes/dcaegen2/components/dcae-redis/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 5573179..2902604 100644 (file)
 # # See the License for the specific language governing permissions and
 # # limitations under the License.
 */}}
-{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) }}
+{{- if eq "True" (include "common.needPV" .) }}
+{{- range $i := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}0
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.fullname" $global }}-data-{{$i}}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
-  storageClassName: manual
   capacity:
-    storage: {{ .Values.persistence.size }}
+    storage: {{ $global.Values.persistence.size}}
   accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
 ---
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}1
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}1
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}2
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}2
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}3
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}3
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}4
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}4
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}5
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}5
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}6
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}6
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}7
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}7
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}8
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}8
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}9
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  storageClassName: manual
-  capacity:
-    storage: {{ .Values.persistence.size }}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}9
-
+{{- end -}}
+{{- end -}}
+{{- end -}}
 {{- end -}}
index 5a5b220..d5fa634 100644 (file)
@@ -96,23 +96,27 @@ spec:
       - name: {{ include "common.fullname" . }}-scripts
         configMap:
           name: {{ include "common.fullname" . }}-scripts
-          defaultMode: 0755 
+          defaultMode: 0755
       - name: localtime
         hostPath:
           path: /etc/localtime
+      {{- if not .Values.persistence.enabled }}
+      - name: {{ include "common.fullname" . }}-data
+        emptyDir: {}
+      {{- end }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
+  {{- if .Values.persistence.enabled }}
   volumeClaimTemplates:
   - metadata:
       name: {{ include "common.fullname" . }}-data
       labels:
-        name: {{ include "common.fullname" . }}      
+        name: {{ include "common.fullname" . }}
     spec:
-      accessModes: [ {{ .Values.persistence.accessMode }} ]
-      storageClassName: manual
+      accessModes:
+      - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.storageClass" . }}
       resources:
         requests:
-          storage: {{ .Values.persistence.size }}
-      selector:
-        matchLabels:
-          name: {{ include "common.fullname" . }}
+          storage: {{ .Values.persistence.size | quote}}
+  {{- end }}
index 40812f2..0b342e8 100644 (file)
@@ -93,7 +93,15 @@ persistence:
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "dcaeredis"
+      name: "dcae-redis"
+      port: 6379
+    - baseaddr: "dcaeredisgossip"
+      name: "dcae-redis"
+      port: 16379
+  config:
+    ssl: "none"
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
index f362f1c..36963bf 100644 (file)
@@ -1,4 +1,3 @@
-
 # Modifications Copyright © 2018 Amdocs,Bell Canada
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -47,6 +46,39 @@ spec:
         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-aaf-readiness
+      - name: {{ include "common.name" . }}-dbc-aaf-config
+        image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
+        volumeMounts:
+        - mountPath: {{ .Values.persistence.aafCredsPath }}
+          name: {{ include "common.name" . }}-aaf-config
+        env:
+        - name: APP_FQI
+          value: "{{ .Values.aafConfig.fqi }}"
+        - name: aaf_locate_url
+          value: "https://aaf-locate.{{ .Release.Namespace }}:8095"
+        - name: aaf_locator_container
+          value: "{{ .Values.global.aafLocatorContainer }}"
+        - name: aaf_locator_container_ns
+          value: "{{ .Release.Namespace }}"
+        - name: aaf_locator_fqdn
+          value: "{{ .Values.aafConfig.fqdn }}"
+        - name: aaf_locator_public_fqdn
+          value: "{{.Values.aafConfig.publicFqdn}}"
+        - name: aaf_locator_app_ns
+          value: "{{ .Values.global.aafAppNs }}"
+        - name: DEPLOY_FQI
+          value: "{{ .Values.aafConfig.aafDeployFqi }}"
+        - name: DEPLOY_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: {{ include "common.fullname" . }}-secret
+              key: aaf-deploy-password
+        - name: cadi_longitude
+          value: "{{ .Values.aafConfig.cadiLongitude }}"
+        - name: cadi_latitude
+          value: "{{ .Values.aafConfig.cadiLatitude }}"
 {{- end }}
 {{- if .Values.PG.enabled }}
       - command:
diff --git a/kubernetes/dmaap/components/dmaap-bc/templates/ingress.yaml b/kubernetes/dmaap/components/dmaap-bc/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
@@ -1,4 +1,5 @@
-# Copyright © 2017 Amdocs, Bell Canada, Orange
+
+# Modifications Copyright © 2019 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -12,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+{{- if .Values.global.aafEnabled }}
 apiVersion: v1
 kind: Secret
 metadata:
@@ -24,5 +26,5 @@ metadata:
     heritage: {{ .Release.Service }}
 type: Opaque
 data:
-  db-user-password: {{ index .Values "mariadb-galera" "config" "userPassword" | b64enc | quote }}
-  db-root-password: {{ index .Values "mariadb-galera" "config" "mariadbRootPassword" | b64enc | quote }}
+  aaf-deploy-password: {{ index .Values.aafConfig.aafDeployPass | b64enc | quote }}
+{{- end }}
index 171ac45..f0e9e17 100644 (file)
@@ -47,6 +47,19 @@ topicMgrPwd: demo123456!
 adminUser: aaf_admin@people.osaaf.org
 adminPwd: demo123456!
 
+#AAF local config
+aafConfig:
+  aafDeployFqi: dmaap-bc@dmaap-bc.onap.org
+  aafDeployPass: demo123456!
+  fqdn: dmaap-bc
+  fqi: dmaap-bc@dmaap-bc.onap.org
+  publicFqdn: dmaap-bc.onap.org
+  cadiLatitude: 0.0
+  cadiLongitude: 0.0
+
+persistence:
+  aafCredsPath: /opt/app/osaaf/local
+
 # for Casablanca default deployment, leave this true to
 # get a topic namespace that matches MR.  When set to false,
 # it will compose the topic namespace using the kubernetes namespace value
@@ -120,6 +133,12 @@ postgres:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "dmaapbc"
+      name: "dmaap-bc"
+      port: 8443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/ingress.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 01309ac..1b992af 100644 (file)
@@ -80,6 +80,12 @@ aafConfig:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "dmaapdrnode"
+      name: "dmaap-dr-node"
+      port: 8443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/ingress.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 8c81f1e..80b15c7 100644 (file)
@@ -62,6 +62,12 @@ persistence:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "dmaapdrprov"
+      name: "dmaap-dr-prov"
+      port: 8443
+  config:
+    ssl: "redirect"
 
 config:
   # dr provisioning server configuration
diff --git a/kubernetes/log/charts/log-elasticsearch/templates/ingress.yaml b/kubernetes/log/charts/log-elasticsearch/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index fd21cdf..fdea287 100644 (file)
@@ -17,7 +17,7 @@
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.fullname" . }}-data
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -31,6 +31,7 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
index abab145..d2eddc2 100644 (file)
@@ -29,11 +29,9 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
index 11e3727..d43a66a 100644 (file)
@@ -94,7 +94,12 @@ service:
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "loges"
+      name: "log-es"
+      port: 9200
+  config:
+    ssl: "none"
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
diff --git a/kubernetes/log/charts/log-kibana/templates/ingress.yaml b/kubernetes/log/charts/log-kibana/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 5132768..d69ab8e 100644 (file)
@@ -77,8 +77,15 @@ service:
   externalPort: 5601
   internalPort: 5601
   nodePort: 53
+
 ingress:
   enabled: false
+  service:
+    - baseaddr: "logkibana"
+      name: "log-kibana"
+      port: 5601
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/log/charts/log-logstash/templates/ingress.yaml b/kubernetes/log/charts/log-logstash/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 246b812..a6e6c96 100644 (file)
@@ -74,6 +74,15 @@ service:
   internalPort2: 9600
 ingress:
   enabled: false
+  service:
+    - baseaddr: "logls"
+      name: "log-ls"
+      port: 5044
+    - baseaddr: "loglshttp"
+      name: "log-ls"
+      port: 9600
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
index d1e1b04..68696fb 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 */}}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -31,6 +32,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 74ba690..d3d5d9e 100644 (file)
@@ -29,19 +29,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
diff --git a/kubernetes/msb/charts/msb-consul/templates/ingress.yaml b/kubernetes/msb/charts/msb-consul/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 1693f22..d116497 100644 (file)
@@ -57,6 +57,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "msbconsul"
+      name: "msb-consul"
+      port: 8500
+  config:
+    ssl: "none"
 
 flavor: small
 
diff --git a/kubernetes/msb/charts/msb-discovery/templates/ingress.yaml b/kubernetes/msb/charts/msb-discovery/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 10315d6..abb1277 100644 (file)
@@ -59,6 +59,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "msbdiscovery"
+      name: "msb-discovery"
+      port: 10081
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/msb/charts/msb-eag/templates/ingress.yaml b/kubernetes/msb/charts/msb-eag/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index e7bf415..535c135 100644 (file)
@@ -62,6 +62,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "msbeag"
+      name: "msb-eag"
+      port: 443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/msb/charts/msb-iag/templates/ingress.yaml b/kubernetes/msb/charts/msb-iag/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 4aaeaea..6d1f7ac 100644 (file)
@@ -63,6 +63,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "msbiag"
+      name: "msb-iag"
+      port: 443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 62203fb..db801e0 100644 (file)
@@ -15,8 +15,8 @@
 */}}
 
 {{- if .Values.global.alertmanager.enabled -}}
-
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -34,8 +34,9 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 8ea5fac..f4e237c 100644 (file)
@@ -32,21 +32,12 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
 
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index aa3a956..6cc1b93 100644 (file)
@@ -15,8 +15,8 @@
 */}}
 
 {{- if .Values.global.grafana.enabled -}}
-
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,9 +33,10 @@ spec:
     storage: {{ .Values.persistence.size}}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 2900395..e629fc2 100644 (file)
@@ -32,21 +32,12 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
 
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index 961b6bb..6a75441 100644 (file)
@@ -15,8 +15,8 @@
 */}}
 
 {{- if .Values.global.prometheus.enabled -}}
-
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,9 +33,10 @@ spec:
     storage: {{ .Values.persistence.size}}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
-
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 73fcc30..4cc525a 100644 (file)
@@ -32,21 +32,12 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
 
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index e2e326d..d7464b1 100644 (file)
@@ -15,6 +15,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -32,6 +33,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index 5bc04cd..d138732 100644 (file)
@@ -30,11 +30,9 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      app: {{ include "common.name" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
index 9fd0789..645b826 100644 (file)
@@ -23,6 +23,7 @@ global:
   artifactImage: onap/multicloud/framework-artifactbroker:1.4.2
   prometheus:
     enabled: false
+  persistence: {}
 
 #################################################################
 # Application configuration defaults.
index c4d65a7..f0c4b8e 100644 (file)
@@ -26,3 +26,8 @@ dependencies:
   - name: mariadb-galera
     version: ~5.x-0
     repository: '@local'
+    condition: global.mariadbGalera.localCluster
+  - name: mariadb-init
+    version: ~5.x-0
+    repository: '@local'
+    condition: not global.mariadbGalera.localCluster
index dc66319..4ba28b0 100644 (file)
@@ -30,7 +30,7 @@ spec:
       labels:
         app: {{ include "common.name" . }}
         release: {{ .Release.Name }}
-        name: {{ include "common.fullname" . }}
+      name: {{ include "common.fullname" . }}
     spec:
       containers:
         - name: {{ include "common.name" . }}
@@ -54,14 +54,14 @@ spec:
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
             - name: SPRING_DATASOURCE_URL
-              value: jdbc:mariadb://{{ index .Values "mariadb-galera" "service" "name" }}.{{ include "common.namespace" . }}:3306/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
+              value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
             - name: SPRING_DATASOURCE_USERNAME
               value: {{ index .Values "mariadb-galera" "config" "userName" }}
             - name: SPRING_DATASOURCE_PASSWORD
               valueFrom:
                 secretKeyRef:
-                  name: {{ template "common.fullname" . }}-secret
-                  key: db-user-password
+                  name: {{ include "common.mariadbSecret" . }}
+                  key: {{ include "common.mariadbSecretParam" . }}
             - name: SPRING_DATA_MONGODB_HOST
               value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
             - name: SPRING_DATA_MONGODB_PORT
diff --git a/kubernetes/nbi/tests/deployment_test.yaml b/kubernetes/nbi/tests/deployment_test.yaml
new file mode 100644 (file)
index 0000000..7c8a1b0
--- /dev/null
@@ -0,0 +1,205 @@
+---
+suite: test deployment behavior
+templates:
+  - deployment.yaml
+tests:
+  - it: "should render with default values (global)"
+    asserts:
+      - isKind:
+          of: Deployment
+      - equal:
+          path: metadata.name
+          value: RELEASE-NAME-nbi
+      - equal:
+          path: metadata.namespace
+          value: NAMESPACE
+      - matchRegex:
+          path: metadata.labels.app
+          pattern: nbi
+      - matchRegex:
+          path: spec.template.metadata.labels.app
+          pattern: nbi
+      - equal:
+          path: spec.template.metadata.name
+          value: RELEASE-NAME-nbi
+      - equal:
+          path: spec.replicas
+          value: 1
+      - isNull:
+          path: spec.template.spec.nodeSelector
+      - isNull:
+          path: spec.template.spec.affinity
+
+  - it: "should render with default value (container)"
+    asserts:
+      - equal:
+          path: spec.template.spec.containers[0].name
+          value: nbi
+      - equal:
+          path: spec.template.spec.containers[0].image
+          value: nexus3.onap.org:10001/onap/externalapi/nbi:5.0.1
+      - equal:
+          path: spec.template.spec.containers[0].imagePullPolicy
+          value: IfNotPresent
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_URL
+            value: jdbc:mariadb://mariadb-galera:3306/nbi
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_USERNAME
+            value: rene
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-nbi-config
+                key: db-user-password
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATA_MONGODB_HOST
+            value: nbi-mongohost.NAMESPACE
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATA_MONGODB_PORT
+            value: "27017"
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATA_MONGODB_DATABASE
+            value: ServiceOrderDB
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: ONAP_LCPCLOUDREGIONID
+            value: RegionOne
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: ONAP_TENANTID
+            value: 31047205ce114b60833b23e400d6a535
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: ONAP_CLOUDOWNER
+            value: CloudOwner
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: NBI_URL
+            value: http://nbi.NAMESPACE:8080/nbi/api/v4
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SDC_HOST
+            value: https://sdc-be.NAMESPACE:8443
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SDC_HEADER_ECOMPINSTANCEID
+            value: OOM
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SDC_HEADER_AUTHORIZATION
+            value: Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: AAI_HOST
+            value: https://aai.NAMESPACE:8443
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: AAI_HEADER_AUTHORIZATION
+            value: Basic QUFJOkFBSQ==
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SO_HOST
+            value: http://so.NAMESPACE:8080
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: DMAAP_HOST
+            value: http://message-router.NAMESPACE:3904
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: LOGGING_LEVEL_ORG_ONAP_NBI
+            value: INFO
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MSB_ENABLED
+            value: "true"
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MSB_DISCOVERY_HOST
+            value: msb-discovery.NAMESPACE
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: MSB_DISCOVERY_PORT
+            value: "10081"
+      - equal:
+          path: spec.template.spec.containers[0].livenessProbe
+          value:
+            initialDelaySeconds: 180
+            periodSeconds: 30
+            tcpSocket:
+              port: 8080
+      - equal:
+          path: spec.template.spec.containers[0].readinessProbe
+          value:
+            initialDelaySeconds: 185
+            periodSeconds: 30
+            tcpSocket:
+              port: 8080
+      - contains:
+          path: spec.template.spec.containers[0].ports
+          content:
+            containerPort: 8080
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.cpu
+          value: 1
+      - equal:
+          path: spec.template.spec.containers[0].resources.limits.memory
+          value: 2Gi
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.cpu
+          value: 100m
+      - equal:
+          path: spec.template.spec.containers[0].resources.requests.memory
+          value: 1Gi
+  - it: "should render when deciding to use local cluster (container)"
+    set:
+      global:
+        mariadbGalera:
+          localCluster: true
+    asserts:
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_URL
+            value: jdbc:mariadb://nbi-galera:3306/nbi
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_USERNAME
+            value: rene
+      - contains:
+          path: spec.template.spec.containers[0].env
+          content:
+            name: SPRING_DATASOURCE_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: RELEASE-NAME-nbi-nbi-galera
+                key: user-password
index 28a5f8d..30f7d2d 100644 (file)
 global:
   nodePortPrefix: 302
   readinessRepository: oomk8s
-  readinessImage: readiness-check:1.1.0
+  readinessImage: readiness-check:2.0.2
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
+  mariadbGalera: &mariadbGalera
+    #This flag allows SO to instantiate its own mariadb-galera cluster
+    localCluster: false
+    service: mariadb-galera
+    internalPort: 3306
+    nameOverride: mariadb-galera
 
 subChartsOnly:
   enabled: true
@@ -29,7 +35,7 @@ subChartsOnly:
 # application image
 repository: nexus3.onap.org:10001
 image: onap/externalapi/nbi:5.0.1
-pullPolicy: Always
+pullPolicy: IfNotPresent
 sdc_authorization: Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=
 aai_authorization: Basic QUFJOkFBSQ==
 so_authorization:
@@ -45,7 +51,9 @@ config:
   openStackVNFTenantId: 31047205ce114b60833b23e400d6a535
 
 mariadb-galera:
-  config:
+  # '&mariadbConfig' means we "store" the values for  later use in the file
+  # with '*mariadbConfig' pointer.
+  config: &mariadbConfig
       userName: rene
       userPassword: lkjgklqsdareyhjujlnnbvfvdttuiukgpiokqbfsjdhfigquosegombvjfqhb
       mariadbRootPassword: dhqjdshjdsguryebvcnbvcvdsqghyjqgktgjjfhjfghbfs
@@ -54,11 +62,16 @@ mariadb-galera:
   service:
     name: nbi-galera
     portName: nbi-galera
+    internalPort: 3306
   replicaCount: 1
   persistence:
     enabled: true
     mountSubPath: nbi/maria/data
 
+mariadb-init:
+  config: *mariadbConfig
+  nameOverride: nbi-config
+
 mongo:
   nameOverride: nbi-mongo
   config:
index 70c4721..314622f 100755 (executable)
@@ -92,10 +92,6 @@ dependencies:
     version: ~5.x-0
     repository: '@local'
     condition: nbi.enabled
-  - name: nfs-provisioner
-    version: ~5.x-0
-    repository: '@local'
-    condition: nfs-provisioner.enabled
   - name: pnda
     version: ~5.x-0
     repository: '@local'
index 672ae2e..5344a42 100755 (executable)
@@ -57,6 +57,12 @@ global:
   # flag to enable debugging - application support required
   debugEnabled: false
 
+  #Global ingress configuration
+  ingress:
+    enabled: false
+    virtualhost:
+        enabled: true
+        baseurl: "simpledemo.onap.org"
 #################################################################
 # Enable/disable and configure helm charts (ie. applications)
 # to customize the ONAP deployment.
@@ -113,8 +119,6 @@ nbi:
     # openstack configuration
     openStackRegion: "Yolo"
     openStackVNFTenantId: "1234"
-nfs-provisioner:
-  enabled: false
 policy:
   enabled: false
 pomba:
@@ -169,4 +173,4 @@ vid:
 vnfsdk:
   enabled: false
 modeling:
-  enabled: false
+  enabled: false
\ No newline at end of file
diff --git a/kubernetes/oof/templates/ingress.yaml b/kubernetes/oof/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index a9b2b2a..e540aa0 100644 (file)
@@ -21,6 +21,7 @@ global:
   readinessImage: readiness-check:2.0.0
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
+  persistence: {}
 #################################################################
 # Application configuration defaults.
 #################################################################
@@ -151,3 +152,9 @@ service:
   nodePort: 48
 ingress:
   enabled: false
+  service:
+    - baseaddr: "oofosdf"
+      name: "oof-osdf"
+      port: 8698
+  config:
+    ssl: "none"
\ No newline at end of file
index a98761f..1106f13 100644 (file)
@@ -79,16 +79,9 @@ spec:
           configMap:
             name: {{ include "common.fullname" . }}-secrets
         - name: {{ include "common.fullname" . }}-logs
-          persitentVolumeClaim:
-            claimName: {{ include "common.fullname" . }}-logs
-  volumeClaimTemplates:
-    - metadata:
-        name: {{ include "common.fullname" . }}-logs
-        labels:
-          name: {{ include "common.fullname" . }}
-      spec:
-        accessModes: [ {{ .Values.persistence.accessMode }} ]
-        storageClassName: manual
-        resources:
-          requests:
-            storage: {{ .Values.persistence.size }}
+        {{- if .Values.persistence.enabled }}
+          persistentVolumeClaim:
+            claimName: {{ include "common.fullname" . }}
+        {{- else }}
+          emptyDir: {}
+        {{- end }}
index bf2d40b..0d20b96 100644 (file)
@@ -19,7 +19,7 @@
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-logs
+  name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -34,7 +34,7 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
-
+    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
@@ -1,5 +1,5 @@
 {{/*
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada, Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
 kind: PersistentVolumeClaim
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-data
+  name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
-    app: {{ include "common.fullname" . }}
+    app: {{ include "common.name" . }}
     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
 {{- if .Values.persistence.annotations }}
   annotations:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
@@ -33,11 +31,8 @@ metadata:
 spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
 {{- end -}}
index bf372b3..f45e9d4 100644 (file)
@@ -16,6 +16,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,6 +34,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index 1deed4e..a082319 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
diff --git a/kubernetes/pomba/charts/pomba-data-router/templates/ingress.yaml b/kubernetes/pomba/charts/pomba-data-router/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 3929e41..f891dce 100644 (file)
@@ -70,6 +70,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "pombadatarouter"
+      name: "pomba-data-router"
+      port: 9502
+  config:
+    ssl: "none"
 
 persistence:
   enabled: true
diff --git a/kubernetes/pomba/charts/pomba-kibana/templates/ingress.yaml b/kubernetes/pomba/charts/pomba-kibana/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 53725b7..c892f1b 100644 (file)
@@ -80,8 +80,15 @@ service:
   externalPort: 5601
   internalPort: 5601
   nodePort: 34
+
 ingress:
   enabled: false
+  service:
+    - baseaddr: "pombakibana"
+      name: "pomba-kibana"
+      port: 5601
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/templates/ingress.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index dba7f59..ae613c6 100644 (file)
@@ -94,7 +94,13 @@ service:
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "pombanetworkdiscovery"
+      name: "pomba-networkdiscovery"
+      port: 8443
+  config:
+    ssl: "redirect"
+    
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
diff --git a/kubernetes/portal/charts/portal-app/templates/ingress.yaml b/kubernetes/portal/charts/portal-app/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index a0c3d36..59a11ad 100644 (file)
@@ -88,6 +88,12 @@ messageRouter:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: portalapp
+      name: "portal-app"
+      port: 8443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 252ca76..f611924 100644 (file)
@@ -16,6 +16,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,6 +34,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index 1deed4e..a082319 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
index 252ca76..f611924 100644 (file)
@@ -16,6 +16,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,6 +34,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end -}}
+{{- end -}}
index 1deed4e..a082319 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
diff --git a/kubernetes/portal/charts/portal-sdk/templates/ingress.yaml b/kubernetes/portal/charts/portal-sdk/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 8daa148..8572ff8 100644 (file)
@@ -82,6 +82,12 @@ messageRouter:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: portalsdk
+      name: "portal-sdk"
+      port: 8080
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 9dbdd7c..8c84cbd 100644 (file)
@@ -52,3 +52,6 @@ zookeeper:
 messageRouter:
   service:
     name: message-router
+
+ingress:
+  enabled: false
\ No newline at end of file
diff --git a/kubernetes/sdc/charts/sdc-be/templates/ingress.yaml b/kubernetes/sdc/charts/sdc-be/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 5ba797c..8ac6c27 100644 (file)
@@ -73,6 +73,13 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "sdcbe"
+      name: "sdc-be"
+      port: 8080
+  config:
+    ssl: "none"
+
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/sdc/charts/sdc-dcae-dt/templates/ingress.yaml b/kubernetes/sdc/charts/sdc-dcae-dt/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 7a1fffc..df0606f 100644 (file)
@@ -61,6 +61,15 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "dcaedt"
+      name: "sdc-dcae-dt"
+      port: 8186
+    - baseaddr: "dcaedt2"
+      name: "sdc-dcae-dt"
+      port: 9446
+  config:
+    ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/sdc/charts/sdc-dcae-fe/templates/ingress.yaml b/kubernetes/sdc/charts/sdc-dcae-fe/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index f38ef30..a5794b2 100644 (file)
@@ -66,7 +66,15 @@ service:
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "dcaedt"
+      name: "sdc-dcae-fe"
+      port: 8183
+    - baseaddr: "dcaedt2"
+      name: "sdc-dcae-fe"
+      port: 9444
+  config:
+    ssl: "none"
 # Resource Limit flavor -By Default using small
 flavor: small
 # Segregation for Different environment (Small and Large)
index 618b23a..8edf342 100644 (file)
@@ -16,6 +16,7 @@
 */}}
 
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -33,6 +34,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index e1f01b6..5251283 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
 {{- end -}}
\ No newline at end of file
diff --git a/kubernetes/sdc/charts/sdc-fe/templates/ingress.yaml b/kubernetes/sdc/charts/sdc-fe/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 8878f1a..a435b59 100644 (file)
@@ -80,6 +80,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "sdcfe"
+      name: "sdc-fe"
+      port: 9443
+  config:
+    ssl: "redirect"
 
 # Resource Limit flavor -By Default using small
 flavor: small
index b292ff9..70f6d95 100644 (file)
 # limitations under the License.
 */}}
 {{- if and .Values.persistence.enabled (not .Values.cert.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-cert
+  name: {{ include "common.fullname" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -33,6 +34,8 @@ spec:
   accessModes:
     - {{ .Values.cert.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.cert.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.cert.persistence.mountSubPath }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index eb2c372..662370d 100644 (file)
@@ -31,19 +31,10 @@ metadata:
 {{ toYaml .Values.cert.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.cert.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.cert.persistence.size }}
-{{- if .Values.cert.persistence.storageClass }}
-{{- if (eq "-" .Values.cert.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.cert.persistence.storageClass }}"
-{{- end }}
-{{- end }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
diff --git a/kubernetes/sdc/charts/sdc-wfd-be/templates/ingress.yaml b/kubernetes/sdc/charts/sdc-wfd-be/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 5a67965..92903ba 100644 (file)
@@ -85,7 +85,13 @@ service:
 
 ingress:
   enabled: false
-
+  service:
+    - baseaddr: "sdcwfdbe"
+      name: "sdc-wfd-be"
+      port: 8443
+  config:
+    ssl: "redirect"
+    
 resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
index e10de6d..8f87c68 100644 (file)
@@ -1,59 +1 @@
-# Copyright © 2018 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.
-
-{{- define "rules.wf" -}}
-- http:
-    paths:
-      - path: /workflows/
-        backend:
-          serviceName: {{.Values.service.name}}
-          servicePort: {{.Values.service.internalPort}}
-{{- end -}}
-
-{{- if .Values.ingress.enabled }}
-
-apiVersion: extensions/v1beta1
-kind: Ingress
-metadata:
-  name: {{ include "common.fullname" . }}-ingress
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-{{- with .Values.ingress.annotations }}
-  annotations:
-{{ toYaml . | indent 4 }}
-{{- end }}
-spec:
-  rules:
-{{- if .Values.ingress.hosts}}
-{{- range .Values.ingress.hosts}}
-{{- include "rules.wf" $ | nindent 2}}
-{{- if .}}
-    host: {{. | quote}}
-{{- end}}
-{{- end}}
-  tls:
-  - hosts:
-{{- range .Values.ingress.hosts}}
-{{- if .}}
-    - {{ . | quote }}
-{{- end}}
-{{- end }}
-{{- else}}
-{{- include "rules.wf" . | nindent 2}}
-{{- end}}
-{{ end }}
+{{ include "common.ingress" . }}
index 54e0e9b..21c7c17 100644 (file)
@@ -80,16 +80,18 @@ service:
 
 ingress:
   enabled: false
-  hosts: ~
+  service:
+    - baseaddr: "sdcwfdfe"
+      name: "sdc-wfd-fe"
+      port: 8443
   annotations:
     ingress.kubernetes.io/secure-backends: "false"
     nginx.ingress.kubernetes.io/secure-backends: "false"
     nginx.ingress.kubernetes.io/proxy-body-size: "0"
     nginx.ingress.kubernetes.io/ssl-redirect: "true"
     nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
-    nginx.ingress.kubernetes.io/rewrite-target: /workflows/
-    nginx.ingress.kubernetes.io/server-snippet: |
-      underscores_in_headers on;
+    nginx.ingress.kubernetes.io/rewrite-target: "/workflows/"
+    nginx.ingress.kubernetes.io/server-snippet: "underscores_in_headers on"
 
 resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
index 5ae0799..4965d96 100644 (file)
@@ -27,7 +27,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/sdnc-dmaap-listener-image:1.7.4
+image: onap/sdnc-dmaap-listener-image:1.7.6
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 4140790..db7c63c 100644 (file)
@@ -27,7 +27,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/sdnc-ansible-server-image:1.7.4
+image: onap/sdnc-ansible-server-image:1.7.6
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index e8d3743..7ff000e 100644 (file)
@@ -27,7 +27,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/admportal-sdnc-image:1.7.4
+image: onap/admportal-sdnc-image:1.7.6
 config:
   dbRootPassword: secretpassword
   dbSdnctlPassword: gamma
index cbbee96..b4b42fd 100644 (file)
@@ -27,7 +27,7 @@ global:
 #################################################################
 # application image
 repository: nexus3.onap.org:10001
-image: onap/sdnc-ueb-listener-image:1.7.4
+image: onap/sdnc-ueb-listener-image:1.7.6
 pullPolicy: Always
 
 # flag to enable debugging - application support required
diff --git a/kubernetes/sdnc/templates/ingress.yaml b/kubernetes/sdnc/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 6ca69c6..555409f 100644 (file)
@@ -32,7 +32,7 @@ global:
 # application images
 repository: nexus3.onap.org:10001
 pullPolicy: Always
-image: onap/sdnc-image:1.7.4
+image: onap/sdnc-image:1.7.6
 
 
 # flag to enable debugging - application support required
@@ -255,6 +255,12 @@ certpersistence:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "sdnc"
+      name: "sdnc"
+      port: 8443
+  config:
+    ssl: "redirect"
 
 #Resource Limit flavor -By Default using small
 flavor: small
index 5f5d09e..f8315ef 100644 (file)
@@ -36,6 +36,7 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
 {{- end }}
index 92d5eed..17ff773 100644 (file)
@@ -33,20 +33,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}-migration
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
+  storageClassName: {{ include "common.storageClass" . }}
 {{- end }}
-{{- end }}
-{{- end }}
-
diff --git a/kubernetes/uui/charts/uui-server/templates/ingress.yaml b/kubernetes/uui/charts/uui-server/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index c58eb81..e7856d3 100644 (file)
@@ -64,6 +64,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: uuiserver
+      name: "uui-server"
+      port: 8082
+  config:
+    ssl: "none"
 
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
diff --git a/kubernetes/uui/templates/ingress.yaml b/kubernetes/uui/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 4d1f888..bfecdb7 100644 (file)
@@ -64,6 +64,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: uui
+      name: "uui"
+      port: 8080
+  config:
+    ssl: "none"
 
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
index d1e1b04..68696fb 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 */}}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
@@ -31,6 +32,8 @@ spec:
   accessModes:
     - {{ .Values.persistence.accessMode }}
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+{{- end -}}
index 74ba690..d3d5d9e 100644 (file)
@@ -29,19 +29,10 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
-  selector:
-    matchLabels:
-      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
+  storageClassName: {{ include "common.storageClass" . }}
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
-  storageClassName: ""
-{{- else }}
-  storageClassName: "{{ .Values.persistence.storageClass }}"
-{{- end }}
-{{- end }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
diff --git a/kubernetes/vid/templates/ingress.yaml b/kubernetes/vid/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index f20e58f..af39823 100644 (file)
@@ -68,6 +68,7 @@ mariadb-galera:
     enabled: true
     mountSubPath: vid/maria/data
   externalConfig: |-
+    [mysqld]
     lower_case_table_names = 1
 
 # default number of instances
@@ -101,6 +102,12 @@ service:
 
 ingress:
   enabled: false
+  service:
+       - baseaddr: "vid"
+         name: "vid-http"
+         port: 8080
+  config:
+       ssl: "none"
 
 # Resource Limit flavor -By Default using small
 flavor: small
diff --git a/kubernetes/vnfsdk/templates/ingress.yaml b/kubernetes/vnfsdk/templates/ingress.yaml
new file mode 100644 (file)
index 0000000..8f87c68
--- /dev/null
@@ -0,0 +1 @@
+{{ include "common.ingress" . }}
index 2b6fd99..55f81ac 100644 (file)
@@ -113,3 +113,9 @@ service:
 
 ingress:
   enabled: false
+  service:
+    - baseaddr: "refrepo"
+      name: "refrepo"
+      port: 97
+  config:
+    ssl: "none"