From ed305414f63ba7b4a2a1325d6f082d1d91d163ed Mon Sep 17 00:00:00 2001 From: Deepak Kinni Date: Thu, 16 Jan 2025 13:08:42 -0800 Subject: [PATCH] Remove metrics port from backup-driver deployment (#601) Signed-off-by: Deepak Kinni --- ...ate-deployment-for-backupdriver-guest.yaml | 8 ----- .../create-deployment-for-backupdriver.yaml | 8 ----- deployment/create-deployment-for-plugin.yaml | 8 ----- pkg/install/deployment.go | 1 - pkg/install/install.go | 33 +++++++------------ 5 files changed, 12 insertions(+), 46 deletions(-) diff --git a/deployment/create-deployment-for-backupdriver-guest.yaml b/deployment/create-deployment-for-backupdriver-guest.yaml index fbbe5ef0..c3dd0a9c 100644 --- a/deployment/create-deployment-for-backupdriver-guest.yaml +++ b/deployment/create-deployment-for-backupdriver-guest.yaml @@ -31,10 +31,6 @@ spec: type: RollingUpdate template: metadata: - annotations: - prometheus.io/path: /metrics - prometheus.io/port: "8085" - prometheus.io/scrape: "true" creationTimestamp: null labels: component: velero @@ -55,10 +51,6 @@ spec: image: dpcpinternal/backup-driver: imagePullPolicy: IfNotPresent name: backup-driver - ports: - - containerPort: 8085 - name: metrics - protocol: TCP resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File diff --git a/deployment/create-deployment-for-backupdriver.yaml b/deployment/create-deployment-for-backupdriver.yaml index 982fb9f0..8abde5ad 100644 --- a/deployment/create-deployment-for-backupdriver.yaml +++ b/deployment/create-deployment-for-backupdriver.yaml @@ -31,10 +31,6 @@ spec: type: RollingUpdate template: metadata: - annotations: - prometheus.io/path: /metrics - prometheus.io/port: "8085" - prometheus.io/scrape: "true" creationTimestamp: null labels: component: velero @@ -55,10 +51,6 @@ spec: image: dpcpinternal/backup-driver: imagePullPolicy: IfNotPresent name: backup-driver - ports: - - containerPort: 8085 - name: metrics - protocol: TCP resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File diff --git a/deployment/create-deployment-for-plugin.yaml b/deployment/create-deployment-for-plugin.yaml index cd631b0a..28db0efb 100644 --- a/deployment/create-deployment-for-plugin.yaml +++ b/deployment/create-deployment-for-plugin.yaml @@ -42,10 +42,6 @@ spec: type: RollingUpdate template: metadata: - annotations: - prometheus.io/path: /metrics - prometheus.io/port: "8085" - prometheus.io/scrape: "true" creationTimestamp: null labels: component: velero @@ -72,10 +68,6 @@ spec: image: gcr.io/heptio-images/velero:v1.1.0 imagePullPolicy: IfNotPresent name: velero - ports: - - containerPort: 8085 - name: metrics - protocol: TCP resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File diff --git a/pkg/install/deployment.go b/pkg/install/deployment.go index b6e7e405..13f27676 100644 --- a/pkg/install/deployment.go +++ b/pkg/install/deployment.go @@ -96,7 +96,6 @@ func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment { Name: "backup-driver", Image: c.image, - Ports: containerPorts(), ImagePullPolicy: pullPolicy, Command: []string{ "/backup-driver", diff --git a/pkg/install/install.go b/pkg/install/install.go index 977464a2..383a35ed 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -67,17 +67,17 @@ var CRDsList = []string{ // DefaultImage is the default image to use for the Velero deployment and restic daemonset containers. var ( - DefaultDatamgrImage = imageRegistry() + "/" + constants.DataManagerForPlugin + ":" + imageVersion() - DefaultDatamgrPodCPURequest = "0" - DefaultDatamgrPodMemRequest = "0" - DefaultDatamgrPodCPULimit = "0" - DefaultDatamgrPodMemLimit = "0" - - DefaultBackupDriverImage = imageRegistry() + "/" + constants.BackupDriverForPlugin + ":" + imageVersion() - DefaultBackupDriverPodCPURequest = "0" - DefaultBackupDriverPodMemRequest = "0" - DefaultBackupDriverPodCPULimit = "0" - DefaultBackupDriverPodMemLimit = "0" + DefaultDatamgrImage = imageRegistry() + "/" + constants.DataManagerForPlugin + ":" + imageVersion() + DefaultDatamgrPodCPURequest = "0" + DefaultDatamgrPodMemRequest = "0" + DefaultDatamgrPodCPULimit = "0" + DefaultDatamgrPodMemLimit = "0" + + DefaultBackupDriverImage = imageRegistry() + "/" + constants.BackupDriverForPlugin + ":" + imageVersion() + DefaultBackupDriverPodCPURequest = "0" + DefaultBackupDriverPodMemRequest = "0" + DefaultBackupDriverPodCPULimit = "0" + DefaultBackupDriverPodMemLimit = "0" ) type PodOptions struct { @@ -92,7 +92,7 @@ type PodOptions struct { SecretAdd bool MasterAffinity bool HostNetwork bool - Features []string + Features []string } // Use "latest" if the build process didn't supply a version @@ -124,15 +124,6 @@ func objectMeta(namespace, name string) metav1.ObjectMeta { } } -func containerPorts() []corev1.ContainerPort { - return []corev1.ContainerPort{ - { - Name: "metrics", - ContainerPort: 8085, - }, - } -} - // createResource attempts to create a resource in the cluster. // If the resource already exists in the cluster, it's merely logged. func createResource(r *unstructured.Unstructured, factory client.DynamicFactory, w io.Writer) error {