From ae4a2ab23c499bd15d56a22534d37fcef11fe28f Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Thu, 1 Dec 2022 14:49:16 +0100 Subject: [PATCH] Remove obsolete volumes, cleanup pvc handling (#818) --- .../extensions-all-jvm-deployment.yaml | 7 ---- .../pipeline-elements/files-pvc.yaml | 42 ------------------- .../sources-vehicle-simulator-deployment.yaml | 41 ------------------ .../sources-vehicle-simulator-service.yaml | 31 -------------- ...ources-watertank-simulator-deployment.yaml | 41 ------------------ .../templates/external/kafka/kafka-pvc.yaml | 2 + .../external/nats/nats-deployment.yaml | 4 -- .../external/zookeeper/zookeeper-pvc.yaml | 2 + 8 files changed, 4 insertions(+), 166 deletions(-) delete mode 100644 installer/k8s/templates/extensions/pipeline-elements/files-pvc.yaml delete mode 100644 installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-deployment.yaml delete mode 100644 installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-service.yaml delete mode 100644 installer/k8s/templates/extensions/pipeline-elements/sources-watertank-simulator-deployment.yaml diff --git a/installer/k8s/templates/extensions/pipeline-elements/extensions-all-jvm-deployment.yaml b/installer/k8s/templates/extensions/pipeline-elements/extensions-all-jvm-deployment.yaml index fb1cf7fe86..4edcdf5542 100644 --- a/installer/k8s/templates/extensions/pipeline-elements/extensions-all-jvm-deployment.yaml +++ b/installer/k8s/templates/extensions/pipeline-elements/extensions-all-jvm-deployment.yaml @@ -27,16 +27,9 @@ spec: labels: app: extensions-all-jvm spec: - volumes: - - name: files-pv - persistentVolumeClaim: - claimName: files-pvc containers: - name: extensions-all-jvm image: {{ .Values.streampipes.registry }}/extensions-all-jvm:{{ .Values.streampipes.version }} imagePullPolicy: {{ .Values.pullPolicy }} ports: - containerPort: 8090 - volumeMounts: - - mountPath: "/spImages" - name: files-pv diff --git a/installer/k8s/templates/extensions/pipeline-elements/files-pvc.yaml b/installer/k8s/templates/extensions/pipeline-elements/files-pvc.yaml deleted file mode 100644 index ee0fb646e1..0000000000 --- a/installer/k8s/templates/extensions/pipeline-elements/files-pvc.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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: PersistentVolume -metadata: - name: files-pv -spec: - storageClassName: local-storage-files - capacity: - storage: 250Mi - accessModes: - - {{ .Values.persistentVolumeAccessModes }} - persistentVolumeReclaimPolicy: {{ .Values.persistentVolumeReclaimPolicy }} - hostPath: - path: {{ .Values.hostPath }}/files ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - app: extensions-all-jvm - name: files-pvc -spec: - storageClassName: local-storage-files - accessModes: - - {{ .Values.persistentVolumeAccessModes }} - resources: - requests: - storage: 250Mi diff --git a/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-deployment.yaml b/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-deployment.yaml deleted file mode 100644 index 083926d939..0000000000 --- a/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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 (eq .Values.deployment "full") }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: sources-vehicle-simulator -spec: - selector: - matchLabels: - app: sources-vehicle-simulator - replicas: 1 - template: - metadata: - labels: - app: sources-vehicle-simulator - spec: - initContainers: - - name: init-wait-kafka - image: alpine - command: ["sh", "-c", "for i in $(seq 1 300); do nc -zvw1 kafka 9092 && exit 0 || sleep 3; done; exit 1"] - containers: - - name: sources-vehicle-simulator - image: {{ .Values.streampipes.registry }}/sources-vehicle-simulator:{{ .Values.streampipes.version }} - imagePullPolicy: {{ .Values.pullPolicy }} - ports: - - containerPort: 8090 -{{- end }} diff --git a/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-service.yaml b/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-service.yaml deleted file mode 100644 index ae02d2c0d0..0000000000 --- a/installer/k8s/templates/extensions/pipeline-elements/sources-vehicle-simulator-service.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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 (eq .Values.deployment "full") }} -apiVersion: v1 -kind: Service -metadata: - name: sources-vehicle-simulator - labels: - name: sources-vehicle-simulator -spec: - selector: - app: sources-vehicle-simulator - ports: - - name: main - protocol: TCP - port: 8090 - targetPort: 8090 -{{- end }} diff --git a/installer/k8s/templates/extensions/pipeline-elements/sources-watertank-simulator-deployment.yaml b/installer/k8s/templates/extensions/pipeline-elements/sources-watertank-simulator-deployment.yaml deleted file mode 100644 index e0cf433ecb..0000000000 --- a/installer/k8s/templates/extensions/pipeline-elements/sources-watertank-simulator-deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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 (eq .Values.deployment "full") }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: sources-watertank-simulator -spec: - selector: - matchLabels: - app: sources-watertank-simulator - replicas: 1 - template: - metadata: - labels: - app: sources-watertank-simulator - spec: - initContainers: - - name: init-wait-kafka - image: alpine - command: ["sh", "-c", "for i in $(seq 1 300); do nc -zvw1 kafka 9092 && exit 0 || sleep 3; done; exit 1"] - containers: - - name: sinks-internal-jvm - image: {{ .Values.streampipes.registry }}/sources-watertank-simulator:{{ .Values.streampipes.version }} - imagePullPolicy: {{ .Values.pullPolicy }} - ports: - - containerPort: 8090 -{{- end }} \ No newline at end of file diff --git a/installer/k8s/templates/external/kafka/kafka-pvc.yaml b/installer/k8s/templates/external/kafka/kafka-pvc.yaml index 894ae6c736..d9b2f359a4 100644 --- a/installer/k8s/templates/external/kafka/kafka-pvc.yaml +++ b/installer/k8s/templates/external/kafka/kafka-pvc.yaml @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- if eq .Values.preferredBroker "kafka" }} apiVersion: v1 kind: PersistentVolume metadata: @@ -40,3 +41,4 @@ spec: resources: requests: storage: 50M +{{- end }} diff --git a/installer/k8s/templates/external/nats/nats-deployment.yaml b/installer/k8s/templates/external/nats/nats-deployment.yaml index d9c27cf75b..7c68608250 100644 --- a/installer/k8s/templates/external/nats/nats-deployment.yaml +++ b/installer/k8s/templates/external/nats/nats-deployment.yaml @@ -32,10 +32,6 @@ spec: - name: init-wait-consul image: alpine command: ["sh", "-c", "for i in $(seq 1 300); do nc -zvw1 consul 8500 && exit 0 || sleep 3; done; exit 1"] - volumes: - - name: kafka-pv - persistentVolumeClaim: - claimName: kafka-pvc containers: - name: nats image: nats diff --git a/installer/k8s/templates/external/zookeeper/zookeeper-pvc.yaml b/installer/k8s/templates/external/zookeeper/zookeeper-pvc.yaml index 741bc9b158..679ad20624 100644 --- a/installer/k8s/templates/external/zookeeper/zookeeper-pvc.yaml +++ b/installer/k8s/templates/external/zookeeper/zookeeper-pvc.yaml @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- if eq .Values.preferredBroker "kafka" }} apiVersion: v1 kind: PersistentVolume metadata: @@ -40,3 +41,4 @@ spec: resources: requests: storage: 20M +{{- end }}