Repository: VictoriaMetrics/operator

Issue:
Use existing PV for VLSingle storage
Currently, VLSingle `spec.storage` takes a PersistentVolumeClaimSpec. This means there is no clear way to declare a volume separately outside the CRD.

Discussion:
@AndrewChubatiuk: have you tried VLSIngle's `spec.volumes` and `spec.volumeMounts` @bo0tzz: I have not - but if that's the canonical way to specify an existing volume, it should probably be described in the docs.@f41gh7: It'd be great to have an examples for both `VMSingle` and `VLSingle` configurations. Because currently, it requires non-trivial steps to mount exist PVC.@makasim: Hey @AndrewChubatiuk, would you mind adding a few examples?@makasim: Closing as resolved. The example was added in https://github.com/VictoriaMetrics/operator/pull/1488 and is now available in the documentation: https://docs.victoriametrics.com/operator/resources/vlsingle/#vlsingle-with-existing-volume


Feel free to reopen if any questions remain. 

Solution patch:
diff --git a/api/operator/v1beta1/vmagent_types.go b/api/operator/v1beta1/vmagent_types.go
index 46e18d20..ecdb2c96 100644
--- a/api/operator/v1beta1/vmagent_types.go
+++ b/api/operator/v1beta1/vmagent_types.go
@@ -83,7 +83,7 @@ type VMAgentSpec struct {
 	VMAgentExternalLabelName *string `json:"vmAgentExternalLabelName,omitempty"`
 
 	// RemoteWrite list of victoria metrics /some other remote write system
-	// for vm it must looks like: http://victoria-metrics-single:8429/api/v1/write
+	// for vm it must looks like: http://victoria-metrics-single:8428/api/v1/write
 	// or for cluster different url
 	// https://docs.victoriametrics.com/victoriametrics/vmagent/#splitting-data-streams-among-multiple-systems
 	RemoteWrite []VMAgentRemoteWriteSpec `json:"remoteWrite"`
diff --git a/api/operator/v1beta1/vmsingle_types.go b/api/operator/v1beta1/vmsingle_types.go
index 094ab6af..7b811895 100644
--- a/api/operator/v1beta1/vmsingle_types.go
+++ b/api/operator/v1beta1/vmsingle_types.go
@@ -297,7 +297,7 @@ func (cr *VMSingle) IsOwnsServiceAccount() bool {
 func (cr *VMSingle) AsURL() string {
 	port := cr.Spec.Port
 	if port == "" {
-		port = "8429"
+		port = "8428"
 	}
 	if cr.Spec.ServiceSpec != nil && cr.Spec.ServiceSpec.UseAsDefault {
 		for _, svcPort := range cr.Spec.ServiceSpec.Spec.Ports {
diff --git a/api/operator/v1beta1/vmuser_types.go b/api/operator/v1beta1/vmuser_types.go
index ecc1de21..0d2a8557 100644
--- a/api/operator/v1beta1/vmuser_types.go
+++ b/api/operator/v1beta1/vmuser_types.go
@@ -58,7 +58,7 @@ type TargetRef struct {
 	// +optional
 	CRD *CRDRef `json:"crd,omitempty"`
 	// Static - user defined url for traffic forward,
-	// for instance http://vmsingle:8429
+	// for instance http://vmsingle:8428
 	// +optional
 	Static *StaticRef `json:"static,omitempty"`
 	// Paths - matched path to route.
diff --git a/config/crd/overlay/crd.yaml b/config/crd/overlay/crd.yaml
index 648f4dd2..24b7dc6a 100644
--- a/config/crd/overlay/crd.yaml
+++ b/config/crd/overlay/crd.yaml
@@ -8622,7 +8622,7 @@ spec:
               remoteWrite:
                 description: |-
                   RemoteWrite list of victoria metrics /some other remote write system
-                  for vm it must looks like: http://victoria-metrics-single:8429/api/v1/write
+                  for vm it must looks like: http://victoria-metrics-single:8428/api/v1/write
                   or for cluster different url
                   https://docs.victoriametrics.com/victoriametrics/vmagent/#splitting-data-streams-among-multiple-systems
                 items:
@@ -39046,7 +39046,7 @@ spec:
                     static:
                       description: |-
                         Static - user defined url for traffic forward,
-                        for instance http://vmsingle:8429
+                        for instance http://vmsingle:8428
                       properties:
                         url:
                           description: URL http url for given staticRef.
diff --git a/docs/api.md b/docs/api.md
index d50c924f..cba96f6e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -2738,7 +2738,7 @@ Appears in: [VMUserSpec](#vmuserspec)
 | crd<a href="#targetref-crd" id="targetref-crd">#</a><br/>_[CRDRef](#crdref)_ | _(Optional)_<br/>CRD describes exist operator's CRD object,<br />operator generates access url based on CRD params. |
 | hosts<a href="#targetref-hosts" id="targetref-hosts">#</a><br/>_string array_ | _(Required)_<br/> |
 | paths<a href="#targetref-paths" id="targetref-paths">#</a><br/>_string array_ | _(Optional)_<br/>Paths - matched path to route. |
-| static<a href="#targetref-static" id="targetref-static">#</a><br/>_[StaticRef](#staticref)_ | _(Optional)_<br/>Static - user defined url for traffic forward,<br />for instance http://vmsingle:8429 |
+| static<a href="#targetref-static" id="targetref-static">#</a><br/>_[StaticRef](#staticref)_ | _(Optional)_<br/>Static - user defined url for traffic forward,<br />for instance http://vmsingle:8428 |
 | targetRefBasicAuth<a href="#targetref-targetrefbasicauth" id="targetref-targetrefbasicauth">#</a><br/>_[TargetRefBasicAuth](#targetrefbasicauth)_ | _(Optional)_<br/>TargetRefBasicAuth allow an target endpoint to authenticate over basic authentication |
 | target_path_suffix<a href="#targetref-target_path_suffix" id="targetref-target_path_suffix">#</a><br/>_string_ | _(Optional)_<br/>TargetPathSuffix allows to add some suffix to the target path<br />It allows to hide tenant configuration from user with crd as ref.<br />it also may contain any url encoded params. |
 
@@ -3108,7 +3108,7 @@ Appears in: [VMAgent](#vmagent)
 | probeSelector<a href="#vmagentspec-probeselector" id="vmagentspec-probeselector">#</a><br/>_[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#labelselector-v1-meta)_ | _(Optional)_<br/>ProbeSelector defines VMProbe to be selected for target probing.<br />Works in combination with NamespaceSelector.<br />NamespaceSelector nil - only objects at VMAgent namespace.<br />Selector nil - only objects at NamespaceSelector namespaces.<br />If both nil - behaviour controlled by selectAllByDefault |
 | readinessGates<a href="#vmagentspec-readinessgates" id="vmagentspec-readinessgates">#</a><br/>_[PodReadinessGate](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#podreadinessgate-v1-core) array_ | _(Required)_<br/>ReadinessGates defines pod readiness gates |
 | relabelConfig<a href="#vmagentspec-relabelconfig" id="vmagentspec-relabelconfig">#</a><br/>_[ConfigMapKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#configmapkeyselector-v1-core)_ | _(Optional)_<br/>RelabelConfig ConfigMap with global relabel config -remoteWrite.relabelConfig<br />This relabeling is applied to all the collected metrics before sending them to remote storage. |
-| remoteWrite<a href="#vmagentspec-remotewrite" id="vmagentspec-remotewrite">#</a><br/>_[VMAgentRemoteWriteSpec](#vmagentremotewritespec) array_ | _(Required)_<br/>RemoteWrite list of victoria metrics /some other remote write system<br />for vm it must looks like: http://victoria-metrics-single:8429/api/v1/write<br />or for cluster different url<br />https://docs.victoriametrics.com/victoriametrics/vmagent/#splitting-data-streams-among-multiple-systems |
+| remoteWrite<a href="#vmagentspec-remotewrite" id="vmagentspec-remotewrite">#</a><br/>_[VMAgentRemoteWriteSpec](#vmagentremotewritespec) array_ | _(Required)_<br/>RemoteWrite list of victoria metrics /some other remote write system<br />for vm it must looks like: http://victoria-metrics-single:8428/api/v1/write<br />or for cluster different url<br />https://docs.victoriametrics.com/victoriametrics/vmagent/#splitting-data-streams-among-multiple-systems |
 | remoteWriteSettings<a href="#vmagentspec-remotewritesettings" id="vmagentspec-remotewritesettings">#</a><br/>_[VMAgentRemoteWriteSettings](#vmagentremotewritesettings)_ | _(Optional)_<br/>RemoteWriteSettings defines global settings for all remoteWrite urls. |
 | replicaCount<a href="#vmagentspec-replicacount" id="vmagentspec-replicacount">#</a><br/>_integer_ | _(Optional)_<br/>ReplicaCount is the expected size of the Application. |
 | resources<a href="#vmagentspec-resources" id="vmagentspec-resources">#</a><br/>_[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | _(Optional)_<br/>Resources container resource request and limits, https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/<br />if not defined default resources from operator config will be used |
diff --git a/docs/quick-start.md b/docs/quick-start.md
index bd29dfb3..787fd5db 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -172,12 +172,12 @@ That's it! You now have a fully operational VictoriaMetrics storage instance run
 Let’s explore how to interact with the storage. First, you need to make the storage port accessible from your machine.
 To do this, open a separate terminal and run the port-forward command below:
 ```sh
-VMSINGLE_POD_NAME=$(kubectl get pod -n vm -l "app.kubernetes.io/name=vmsingle" -o jsonpath="{.items[0].metadata.name}");
-kubectl port-forward -n vm $VMSINGLE_POD_NAME 8428:8429;
+VMSINGLE_SVC_NAME=$(kubectl get svc -n vm -l "app.kubernetes.io/name=vmsingle" -o jsonpath="{.items[0].metadata.name}");
+kubectl port-forward -n vm svc/$VMSINGLE_SVC_NAME 8428;
 
 # Output:
-# Forwarding from 127.0.0.1:8428 -> 8429
-# Forwarding from [::1]:8428 -> 8429
+# Forwarding from 127.0.0.1:8428 -> 8428
+# Forwarding from [::1]:8428 -> 8428
 ```
 Make sure it stays up and running throughout the rest of this documentation.
 
@@ -250,7 +250,7 @@ metadata:
 spec:
   selectAllByDefault: true
   remoteWrite:
-    - url: "http://vmsingle-demo.vm.svc:8429/api/v1/write"
+    - url: "http://vmsingle-demo.vm.svc:8428/api/v1/write"
 EOF
 ```
 The `selectAllByDefault` setting tells `VMAgent` to look for scrape resources in every namespace.
@@ -383,8 +383,8 @@ This is because the VictoriaMetrics operator automatically creates scrape config
 If you prefer a visual interface, you can use the VMAgent UI.
 First, forward port `8429` from the VMAgent pod to your local machine:
 ```sh
-VMAGENT_POD_NAME=$(kubectl get pod -n vm -l "app.kubernetes.io/name=vmagent" -o jsonpath="{.items[0].metadata.name}");
-kubectl port-forward -n vm $VMAGENT_POD_NAME 8429:8429;
+VMAGENT_SVC_NAME=$(kubectl get svc -n vm -l "app.kubernetes.io/name=vmagent" -o jsonpath="{.items[0].metadata.name}");
+kubectl port-forward -n vm svc/$VMAGENT_SVC_NAME 8429:8429;
 ```
 Then open this URL in your browser: http://localhost:8429/targets
 There, you’ll see all the targets that VMAgent is scraping, their status, the latest metrics, and when each was last scraped.
@@ -458,15 +458,15 @@ metadata:
 spec:
   # Metrics source (VMCluster/VMSingle)
   datasource:
-    url: "http://vmsingle-demo.vm.svc:8429"
+    url: "http://vmsingle-demo.vm.svc:8428"
 
   # Where alert state and recording rules are stored
   remoteWrite:
-    url: "http://vmsingle-demo.vm.svc:8429"
+    url: "http://vmsingle-demo.vm.svc:8428"
 
   # Where the previous alert state is loaded from. Optional
   remoteRead:
-    url: "http://vmsingle-demo.vm.svc:8429"
+    url: "http://vmsingle-demo.vm.svc:8428"
 
   # Alertmanager URL for sending alerts
   notifier:
@@ -534,8 +534,8 @@ kubectl exec -n vm $VMALERT_POD_NAME -c vmalert  -- wget -qO -  http://127.0.0.1
 If you prefer using a web interface, you can open the `VMAlert` UI in your browser.
 First, forward port `8080` from the `VMAlert` pod to your local machine:
 ```sh
-VMALERT_POD_NAME=$(kubectl get pod -n vm -l "app.kubernetes.io/name=vmalert" -o jsonpath="{.items[0].metadata.name}")
-kubectl port-forward -n vm $VMALERT_POD_NAME 8080:8080
+VMALERT_SVC_NAME=$(kubectl get svc -n vm -l "app.kubernetes.io/name=vmalert" -o jsonpath="{.items[0].metadata.name}")
+kubectl port-forward -n vm svc/$VMALERT_SVC_NAME 8080:8080
 ```
 Then go to: http://localhost:8080/vmalert/groups.
 You’ll see all groups, alerts and a lot more.
@@ -820,4 +820,4 @@ Became part of [operator/quick-start/#access](https://docs.victoriametrics.com/o
 
 ###### Anything else
 
-Moved to [operator/quick-start/#next-steps](https://docs.victoriametrics.com/operator/quick-start/#next-steps)
\ No newline at end of file
+Moved to [operator/quick-start/#next-steps](https://docs.victoriametrics.com/operator/quick-start/#next-steps)
diff --git a/docs/resources/vlsingle.md b/docs/resources/vlsingle.md
index 0ec7029e..46d389e3 100644
--- a/docs/resources/vlsingle.md
+++ b/docs/resources/vlsingle.md
@@ -116,6 +116,9 @@ Also, you can specify requests without limits - in this case default values for
 
 ## Examples
 
+
+### VLSingle with resources set
+
 ```yaml
 apiVersion: operator.victoriametrics.com/v1
 kind: VLSingle
@@ -136,6 +139,57 @@ spec:
       cpu: 5
 ```
 
+### VLSingle with existing volume
+
+create PVC and bind it to existing PV `existing-pv-name`
+
+> `spec.storageClassName` should match a storage class name of PersistentVolume
+
+```yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: example-pvc
+spec:
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 10Gi
+  storageClassName: standard
+  volumeName: existing-pv-name
+```
+
+create VLSingle with PVC `example-pvc` mounted
+
+> `spec.replicaCount` should be set to `1` since existing volume can only be mounted once
+
+```yaml
+apiVersion: operator.victoriametrics.com/v1
+kind: VLSingle
+metadata:
+  name: example
+spec:
+  replicaCount: 1
+  retentionPeriod: "12"
+  extraArgs:
+    storageDataPath: /vl-data
+  volumes:
+    - name: vlstorage
+      persistentVolumeClaim:
+        claimName: example-pvc
+  volumeMounts:
+    - name: vlstorage
+      mountPath: /vl-data
+  resources:
+    requests:
+      memory: 500Mi
+      cpu: 500m
+    limits:
+      memory: 10Gi
+      cpu: 5
+```
+
 ## Migration from VLogs
 
  At first, create a new `VLSingle` resource, point clients to the new resource. Use [backup-restore](https://docs.victoriametrics.com/victorialogs/#backup-and-restore) procedure for historical data migration.
diff --git a/docs/resources/vmagent.md b/docs/resources/vmagent.md
index 4d83ea44..6af30f53 100644
--- a/docs/resources/vmagent.md
+++ b/docs/resources/vmagent.md
@@ -195,7 +195,7 @@ spec:
   selectAllByDefault: true
   vmAgentExternalLabelName: vmagent_ha
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   scrapeInterval: 30s
   # Replication:
   replicaCount: 2
@@ -227,7 +227,7 @@ spec:
   selectAllByDefault: true
   vmAgentExternalLabelName: vmagent_ha
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   scrapeInterval: 30s
   # Replication:
   replicaCount: 2
@@ -261,7 +261,7 @@ spec:
   selectAllByDefault: true
   vmAgentExternalLabelName: vmagent_ha
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   # Replication:
   scrapeInterval: 30s
   replicaCount: 2
@@ -332,7 +332,7 @@ spec:
       static_configs:
       - targets: ["localhost:9090"]
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   # ...
 ```
 
@@ -370,7 +370,7 @@ spec:
     name: additional-scrape-configs
     key: prometheus-additional.yaml
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   # ...
 ```
 
@@ -441,8 +441,8 @@ spec:
    name: "vmagent-relabel"
    key: "global-relabel.yaml"
   remoteWrite:
-    - url: "http://vmsingle-example-persisted.default.svc:8429/api/v1/write"
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example-persisted.default.svc:8428/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
       urlRelabelConfig:
         name: "vmagent-relabel"
         key: "target-1-relabel.yaml"
@@ -470,8 +470,8 @@ spec:
    - action: drop
      source_labels: [aaa]
   remoteWrite:
-    - url: "http://vmsingle-example-persisted.default.svc:8429/api/v1/write"
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example-persisted.default.svc:8428/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
       inlineUrlRelabelConfig:
        - action: keep_if_equal
          source_labels: [foo, bar]
@@ -524,8 +524,8 @@ spec:
    name: "vmagent-relabel"
    key: "global-relabel.yaml"
   remoteWrite:
-    - url: "http://vmsingle-example-persisted.default.svc:8429/api/v1/write"
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example-persisted.default.svc:8428/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
       urlRelabelConfig:
         name: "vmagent-relabel"
         key: "target-1-relabel.yaml"
@@ -767,7 +767,7 @@ spec:
     cluster: my-cluster
   vmAgentExternalLabelName: example
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
   inlineRelabelConfig:
     - action: labeldrop
       regex: "temp.*"
@@ -807,7 +807,7 @@ spec:
   selectAllByDefault: true
   daemonSetMode: true
   remoteWrite:
-    - url: "http://vmsingle-example.default.svc:8429/api/v1/write"
+    - url: "http://vmsingle-example.default.svc:8428/api/v1/write"
 ```
 
  daemonSetMode has the following restrictions and limitations:
diff --git a/docs/resources/vmalert.md b/docs/resources/vmalert.md
index f1270695..ea85f364 100644
--- a/docs/resources/vmalert.md
+++ b/docs/resources/vmalert.md
@@ -166,7 +166,7 @@ You have to specify all pod fqdns  at `VMAlert.spec.notifiers.[url]`. Or you can
     spec:
       replicaCount: 2
       datasource:
-        url: http://vmsingle-example.default.svc:8429
+        url: http://vmsingle-example.default.svc:8428
       notifiers:
         - url: http://vmalertmanager-example-0.vmalertmanager-example.default.svc:9093
         - url: http://vmalertmanager-example-1.vmalertmanager-example.default.svc:9093
@@ -184,7 +184,7 @@ You have to specify all pod fqdns  at `VMAlert.spec.notifiers.[url]`. Or you can
     spec:
       replicaCount: 2
       datasource:
-       url: http://vmsingle-example.default.svc:8429
+       url: http://vmsingle-example.default.svc:8428
       notifiers:
         - selector:
             namespaceSelector:
@@ -402,7 +402,7 @@ metadata:
 spec:
   replicaCount: 1
   datasource:
-    url: "http://vmsingle-example-persisted.default.svc:8429"
+    url: "http://vmsingle-example-persisted.default.svc:8428"
   notifier:
     url: "http://vmalertmanager-example.default.svc:9093"
   evaluationInterval: "30s"
diff --git a/docs/resources/vmprobe.md b/docs/resources/vmprobe.md
index 257dcb12..4693bd15 100644
--- a/docs/resources/vmprobe.md
+++ b/docs/resources/vmprobe.md
@@ -235,5 +235,5 @@ spec:
    selectAllByDefault: true
    replicaCount: 1
    remoteWrite:
-     - url: "http://vmsingle-example-persisted.default.svc:8429/api/v1/write"
+     - url: "http://vmsingle-example-persisted.default.svc:8428/api/v1/write"
 ```
diff --git a/docs/security.md b/docs/security.md
index 77888aa1..a49fca48 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -150,7 +150,7 @@ metadata:
   namespace: default
 spec:
   remoteWrite:
-  - url: http://vmsingle-vms-victoria-metrics-k8s-stack.default.svc:8429/api/v1/write
+  - url: http://vmsingle-vms-victoria-metrics-k8s-stack.default.svc:8428/api/v1/write
   replicaCount: 1
   selectAllByDefault: true
   statefulMode: true
@@ -232,7 +232,7 @@ metadata:
 spec:
   disableAutomountServiceAccountToken: true
   remoteWrite:
-  - url: http://vmsingle-vms-victoria-metrics-k8s-stack.default.svc:8429/api/v1/write
+  - url: http://vmsingle-vms-victoria-metrics-k8s-stack.default.svc:8428/api/v1/write
   replicaCount: 1
   selectAllByDefault: true
   statefulMode: true



Test patch:
diff --git a/internal/controller/operator/factory/vlagent/vlagent_test.go b/internal/controller/operator/factory/vlagent/vlagent_test.go
index f99616e4..b2ea2482 100644
--- a/internal/controller/operator/factory/vlagent/vlagent_test.go
+++ b/internal/controller/operator/factory/vlagent/vlagent_test.go
@@ -373,7 +373,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		Spec: vmv1.VLAgentSpec{
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL: "localhost:8429",
+					URL: "localhost:9429",
 					TLSConfig: &vmv1.TLSConfig{
 						CASecret: &corev1.SecretKeySelector{
 							LocalObjectReference: corev1.LocalObjectReference{
@@ -384,7 +384,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 					},
 				},
 				{
-					URL: "localhost:8429",
+					URL: "localhost:9429",
 					TLSConfig: &vmv1.TLSConfig{
 						CAFile: "/path/to_ca",
 						CertSecret: &corev1.SecretKeySelector{
@@ -401,7 +401,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		`-remoteWrite.tlsCAFile=/etc/vl/remote-write-assets/tls-secret/ca,/path/to_ca`,
 		`-remoteWrite.tlsCertFile=,/etc/vl/remote-write-assets/tls-secret/cert`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
-		`-remoteWrite.url=localhost:8429,localhost:8429`,
+		`-remoteWrite.url=localhost:9429,localhost:9429`,
 	},
 	)
 
@@ -414,7 +414,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		Spec: vmv1.VLAgentSpec{
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL: "localhost:8429",
+					URL: "localhost:9429",
 					TLSConfig: &vmv1.TLSConfig{
 						KeySecret: &corev1.SecretKeySelector{
 							LocalObjectReference: corev1.LocalObjectReference{
@@ -428,7 +428,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 			},
 		},
 	}, []string{
-		`-remoteWrite.url=localhost:8429`,
+		`-remoteWrite.url=localhost:9429`,
 		`-remoteWrite.tlsInsecureSkipVerify=true`,
 		`-remoteWrite.tlsKeyFile=/etc/vl/remote-write-assets/tls-secret/key`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
@@ -442,14 +442,14 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL: "localhost:8429",
+				URL: "localhost:9429",
 				TLSConfig: &vmv1.TLSConfig{
 					InsecureSkipVerify: true,
 				},
 			},
 		}},
 	}, []string{
-		`-remoteWrite.url=localhost:8429`,
+		`-remoteWrite.url=localhost:9429`,
 		`-remoteWrite.tlsInsecureSkipVerify=true`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -462,17 +462,17 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL: "localhost:8429",
+				URL: "localhost:9429",
 
 				SendTimeout: ptr.To("10s"),
 			},
 			{
-				URL:         "localhost:8431",
+				URL:         "localhost:9431",
 				SendTimeout: ptr.To("15s"),
 			},
 		}},
 	}, []string{
-		`-remoteWrite.url=localhost:8429,localhost:8431`,
+		`-remoteWrite.url=localhost:9429,localhost:9431`,
 		`-remoteWrite.sendTimeout=10s,15s`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -485,19 +485,19 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL:          "localhost:8429",
+				URL:          "localhost:9429",
 				MaxDiskUsage: ptr.To(vmv1beta1.BytesString("1500MB")),
 			},
 			{
-				URL:          "localhost:8431",
+				URL:          "localhost:9431",
 				MaxDiskUsage: ptr.To(vmv1beta1.BytesString("500MB")),
 			},
 			{
-				URL: "localhost:8432",
+				URL: "localhost:9432",
 			},
 		}},
 	}, []string{
-		`-remoteWrite.url=localhost:8429,localhost:8431,localhost:8432`,
+		`-remoteWrite.url=localhost:9429,localhost:9431,localhost:9432`,
 		`-remoteWrite.maxDiskUsagePerURL=1500MB,500MB,`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -523,19 +523,19 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 			},
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL: "localhost:8429",
+					URL: "localhost:9429",
 				},
 				{
-					URL: "localhost:8431",
+					URL: "localhost:9431",
 				},
 				{
-					URL: "localhost:8432",
+					URL: "localhost:9432",
 				},
 			},
 		},
 	}, []string{
 		`-remoteWrite.maxDiskUsagePerURL=3579139413`,
-		`-remoteWrite.url=localhost:8429,localhost:8431,localhost:8432`,
+		`-remoteWrite.url=localhost:9429,localhost:9431,localhost:9432`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
 
@@ -560,19 +560,19 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 			},
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL:          "localhost:8429",
+					URL:          "localhost:9429",
 					MaxDiskUsage: ptr.To(vmv1beta1.BytesString("5000MB")),
 				},
 				{
-					URL: "localhost:8431",
+					URL: "localhost:9431",
 				},
 				{
-					URL: "localhost:8432",
+					URL: "localhost:9432",
 				},
 			},
 		},
 	}, []string{
-		`-remoteWrite.url=localhost:8429,localhost:8431,localhost:8432`,
+		`-remoteWrite.url=localhost:9429,localhost:9431,localhost:9432`,
 		`-remoteWrite.maxDiskUsagePerURL=5000MB,3579139413,3579139413`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -585,11 +585,11 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL:         "localhost:8429",
+				URL:         "localhost:9429",
 				SendTimeout: ptr.To("10s"),
 			},
 			{
-				URL:         "localhost:8431",
+				URL:         "localhost:9431",
 				SendTimeout: ptr.To("15s"),
 				OAuth2: &vmv1.OAuth2{
 					Scopes:   []string{"scope-1", "scope-2"},
@@ -614,7 +614,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		`-remoteWrite.oauth2.scopes=,scope-1;scope-2`,
 		`-remoteWrite.oauth2.tokenUrl=,http://some-url`,
 		`-remoteWrite.oauth2.endpointParams=,'{"query":"value1","timeout":"30s"}'`,
-		`-remoteWrite.url=localhost:8429,localhost:8431`,
+		`-remoteWrite.url=localhost:9429,localhost:9431`,
 		`-remoteWrite.sendTimeout=10s,15s`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -627,11 +627,11 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL:         "localhost:8429",
+				URL:         "localhost:9429",
 				SendTimeout: ptr.To("10s"),
 			},
 			{
-				URL:         "localhost:8431",
+				URL:         "localhost:9431",
 				SendTimeout: ptr.To("15s"),
 				BearerTokenSecret: &corev1.SecretKeySelector{
 					LocalObjectReference: corev1.LocalObjectReference{Name: "some-secret"},
@@ -641,7 +641,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		}},
 	}, []string{
 		`-remoteWrite.bearerTokenFile=,/etc/vl/remote-write-assets/some-secret/some-key`,
-		`-remoteWrite.url=localhost:8429,localhost:8431`,
+		`-remoteWrite.url=localhost:9429,localhost:9431`,
 		`-remoteWrite.sendTimeout=10s,15s`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -654,11 +654,11 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		},
 		Spec: vmv1.VLAgentSpec{RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 			{
-				URL:         "localhost:8429",
+				URL:         "localhost:9429",
 				SendTimeout: ptr.To("10s"),
 			},
 			{
-				URL:         "localhost:8431",
+				URL:         "localhost:9431",
 				SendTimeout: ptr.To("15s"),
 				BearerTokenSecret: &corev1.SecretKeySelector{
 					LocalObjectReference: corev1.LocalObjectReference{Name: "some-secret"},
@@ -670,7 +670,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 	}, []string{
 		`-remoteWrite.bearerTokenFile=,/etc/vl/remote-write-assets/some-secret/some-key`,
 		`-remoteWrite.headers='','key: value^^second-key: value2'`,
-		`-remoteWrite.url=localhost:8429,localhost:8431`,
+		`-remoteWrite.url=localhost:9429,localhost:9431`,
 		`-remoteWrite.sendTimeout=10s,15s`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
@@ -684,20 +684,20 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		Spec: vmv1.VLAgentSpec{
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL: "http://localhost:8431",
+					URL: "http://localhost:9431",
 				},
 				{
-					URL:      "http://localhost:8432",
+					URL:      "http://localhost:9432",
 					ProxyURL: ptr.To("http://proxy.example.com"),
 				},
 				{
-					URL: "http://localhost:8433",
+					URL: "http://localhost:9433",
 				},
 			},
 		},
 	}, []string{
 		`-remoteWrite.proxyURL=,http://proxy.example.com,`,
-		`-remoteWrite.url=http://localhost:8431,http://localhost:8432,http://localhost:8433`,
+		`-remoteWrite.url=http://localhost:9431,http://localhost:9432,http://localhost:9433`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
 	})
 
@@ -750,7 +750,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		Spec: vmv1.VLAgentSpec{
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL:          "localhost:8431",
+					URL:          "localhost:9431",
 					MaxDiskUsage: ptr.To(vmv1beta1.BytesString("500MB")),
 				},
 			},
@@ -761,7 +761,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 	}, []string{
 		`-remoteWrite.maxDiskUsagePerURL=500MB`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
-		`-remoteWrite.url=localhost:8431`,
+		`-remoteWrite.url=localhost:9431`,
 	})
 
 	// maxDiskUsage already set in RemoteWriteSpec
@@ -773,13 +773,13 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 		Spec: vmv1.VLAgentSpec{
 			RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 				{
-					URL: "localhost:8429",
+					URL: "localhost:9429",
 				},
 				{
-					URL: "localhost:8431",
+					URL: "localhost:9431",
 				},
 				{
-					URL: "localhost:8432",
+					URL: "localhost:9432",
 				},
 			},
 			RemoteWriteSettings: &vmv1.VLAgentRemoteWriteSettings{
@@ -799,7 +799,7 @@ func TestBuildRemoteWriteArgs(t *testing.T) {
 			},
 		},
 	}, []string{
-		`-remoteWrite.url=localhost:8429,localhost:8431,localhost:8432`,
+		`-remoteWrite.url=localhost:9429,localhost:9431,localhost:9432`,
 		`-remoteWrite.maxBlockSize=1000`,
 		`-remoteWrite.maxDiskUsagePerURL=3579139413`,
 		`-remoteWrite.tmpDataPath=/vlagent_pq/vlagent-remotewrite-data`,
diff --git a/test/e2e/vlagent_test.go b/test/e2e/vlagent_test.go
index 250896e9..9b6f98e9 100644
--- a/test/e2e/vlagent_test.go
+++ b/test/e2e/vlagent_test.go
@@ -108,7 +108,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 							ReplicaCount: ptr.To[int32](1),
 						},
 						RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
-							{URL: "http://localhost:8428"},
+							{URL: "http://localhost:9428"},
 						},
 						ServiceSpec: &vmv1beta1.AdditionalServiceSpec{
 							EmbeddedObjectMetadata: vmv1beta1.EmbeddedObjectMetadata{
@@ -147,9 +147,9 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 							},
 						},
 						RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
-							{URL: "http://localhost:8428"},
+							{URL: "http://localhost:9428"},
 							{
-								URL: "http://localhost:8425",
+								URL: "http://localhost:9425",
 								TLSConfig: &vmv1.TLSConfig{
 									CASecret: &corev1.SecretKeySelector{
 										LocalObjectReference: corev1.LocalObjectReference{
@@ -222,7 +222,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 						},
 						RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
 							{
-								URL: "http://localhost:8428",
+								URL: "http://localhost:9428",
 								BearerTokenSecret: &corev1.SecretKeySelector{
 									Key: "token",
 									LocalObjectReference: corev1.LocalObjectReference{
@@ -233,7 +233,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 								MaxDiskUsage: ptr.To(vmv1beta1.BytesString(`10GB`)),
 							},
 							{
-								URL: "http://localhost:8425",
+								URL: "http://localhost:9425",
 								OAuth2: &vmv1.OAuth2{
 									TokenURL:       "http://oauth2.example.com",
 									Scopes:         []string{"scope-1", "scope-2"},
@@ -332,7 +332,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 							DisableAutomountServiceAccountToken: true,
 						},
 						RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
-							{URL: "http://localhost:8428"},
+							{URL: "http://localhost:9428"},
 						},
 					},
 				}, nil, func(cr *vmv1.VLAgent) {
@@ -401,7 +401,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 							ReplicaCount: ptr.To[int32](1),
 						},
 						RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
-							{URL: "http://some-vm-single:8428"},
+							{URL: "http://some-vl-single:9428"},
 						},
 					},
 				},
@@ -422,7 +422,7 @@ var _ = Describe("test vlagent Controller", Label("vl", "agent", "vlagent"), fun
 					},
 					PodDisruptionBudget: &vmv1beta1.EmbeddedPodDisruptionBudgetSpec{MaxUnavailable: &intstr.IntOrString{IntVal: 1}},
 					RemoteWrite: []vmv1.VLAgentRemoteWriteSpec{
-						{URL: "http://some-vm-single:8428"},
+						{URL: "http://some-vl-single:9428"},
 					},
 				},
 				},
diff --git a/test/e2e/vmauth_test.go b/test/e2e/vmauth_test.go
index feb7efe2..a5046a99 100644
--- a/test/e2e/vmauth_test.go
+++ b/test/e2e/vmauth_test.go
@@ -411,7 +411,7 @@ var _ = Describe("test vmauth Controller", Label("vm", "auth"), func() {
   url_map:
   - src_paths:
     - "/.*"
-    url_prefix: "http://vmsingle-some-url:8429"`,
+    url_prefix: "http://vmsingle-some-url:8428"`,
 								},
 							}
 							Expect(k8sClient.Create(ctx, extSecret)).To(Succeed())
@@ -484,7 +484,7 @@ var _ = Describe("test vmauth Controller", Label("vm", "auth"), func() {
   url_map:
   - src_paths:
     - "/.*"
-    url_prefix: "http://vmsingle-some-url:8429"`,
+    url_prefix: "http://vmsingle-some-url:8428"`,
 								},
 							}
 							Expect(k8sClient.Create(ctx, extSecret)).To(Succeed())