Add option to disable specific deployments
Add option to disable any deployment by using conditions in helm
templates. Each deployment will get helm parameter - boolean flag
allowing to disable it. The flags can be listed in the custom
values.yaml file that can be passed to the createAll script with
'-v' command line option.
Change-Id: I32b795de46c72915c2201c94c23f4e061971bb56
Issue-ID: OOM-380
Signed-off-by: yuryn <Yury.Novitsky@Amdocs.com>
diff --git a/kubernetes/log/templates/all-services.yaml b/kubernetes/log/templates/all-services.yaml
index 5f9412e..3984f12 100644
--- a/kubernetes/log/templates/all-services.yaml
+++ b/kubernetes/log/templates/all-services.yaml
@@ -1,3 +1,4 @@
+#{{ if not .Values.disableLogElasticsearch }}
apiVersion: v1
kind: Service
metadata:
@@ -14,6 +15,8 @@
selector:
app: elasticsearch
type: NodePort
+#{{ end }}
+#{{ if not .Values.disableLogLogstash }}
---
apiVersion: v1
kind: Service
@@ -29,6 +32,8 @@
targetPort: 5044
selector:
app: logstash
+#{{ end }}
+#{{ if not .Values.disableLogKibana }}
---
apiVersion: v1
kind: Service
@@ -46,4 +51,4 @@
selector:
app: kibana
type: NodePort
-
+#{{ end }}
\ No newline at end of file
diff --git a/kubernetes/log/templates/elasticsearch-deployment.yaml b/kubernetes/log/templates/elasticsearch-deployment.yaml
index 75df8a1..f0db31a 100644
--- a/kubernetes/log/templates/elasticsearch-deployment.yaml
+++ b/kubernetes/log/templates/elasticsearch-deployment.yaml
@@ -1,3 +1,4 @@
+#{{ if not .Values.disableLogElasticsearch }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -78,4 +79,5 @@
name: elasticsearch-configmap
namespace: {{ .Values.nsPrefix }}-log
data:
-{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
\ No newline at end of file
+{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }}
+#{{ end }}
\ No newline at end of file
diff --git a/kubernetes/log/templates/kibana-deployment.yaml b/kubernetes/log/templates/kibana-deployment.yaml
index f8070ef..9ff26da 100644
--- a/kubernetes/log/templates/kibana-deployment.yaml
+++ b/kubernetes/log/templates/kibana-deployment.yaml
@@ -1,3 +1,4 @@
+#{{ if not .Values.disableLogKibana }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -68,4 +69,5 @@
name: kibana-configmap
namespace: {{ .Values.nsPrefix }}-log
data:
-{{ (.Files.Glob "resources/kibana/conf/kibana.yml").AsConfig | indent 2 }}
\ No newline at end of file
+{{ (.Files.Glob "resources/kibana/conf/kibana.yml").AsConfig | indent 2 }}
+#{{ end }}
\ No newline at end of file
diff --git a/kubernetes/log/templates/log-pv-pvc.yaml b/kubernetes/log/templates/log-pv-pvc.yaml
index 989b118..4f24471 100644
--- a/kubernetes/log/templates/log-pv-pvc.yaml
+++ b/kubernetes/log/templates/log-pv-pvc.yaml
@@ -1,3 +1,4 @@
+#{{ if not .Values.disableLogElasticsearch }}
apiVersion: v1
kind: PersistentVolume
metadata:
@@ -28,3 +29,4 @@
selector:
matchLabels:
name: elasticsearch-db
+#{{ end }}
\ No newline at end of file
diff --git a/kubernetes/log/templates/logstash-deployment.yaml b/kubernetes/log/templates/logstash-deployment.yaml
index 23d5906..c4d46b7 100644
--- a/kubernetes/log/templates/logstash-deployment.yaml
+++ b/kubernetes/log/templates/logstash-deployment.yaml
@@ -1,3 +1,4 @@
+#{{ if not .Values.disableLogLogstash }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -80,3 +81,4 @@
data:
{{ (.Files.Glob "resources/logstash/conf/logstash.yml").AsConfig | indent 2 }}
{{ (.Files.Glob "resources/logstash/pipeline/onap-pipeline.conf").AsConfig | indent 2 }}
+#{{ end }}
\ No newline at end of file