operator icon indicating copy to clipboard operation
operator copied to clipboard

Allow Adjusting Default Service Type for Application Services

Open arcug opened this issue 1 year ago • 1 comments
trafficstars

When deploying clusters in GKE, services that sit behind a GCP LB for the Ingress object require a non-ClusterIP type Service. Are there plans to allow the CRD for the Applications to support a custom Service Type rather than a hard coded ClusterIP type? If not can we issue PR's to address this?

This is the related issue on the helm chart that deploys the operator. https://github.com/VictoriaMetrics/helm-charts/issues/163#issuecomment-1989707794

arcug avatar Mar 12 '24 17:03 arcug

Hello! What about using the serviceSpec? It allows having an extra customized service.

Haleygo avatar Mar 14 '24 10:03 Haleygo

I was thinking of new boolean flag, which could be added to the serviceSpec - useAsDefaultService: true.

In this case, additional service must be deleted and all properties of it applied to the default service.

This change may require service recreation - if any immutable fields for it changes.

f41gh7 avatar Apr 03 '24 11:04 f41gh7

Must be fixed at v0.43.0 release.

Operator allows to modify exist service with serviceSpec if useAsDefault option is set to true

---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMCluster
metadata:
  name: example-service-change
spec:
  retentionPeriod: "4"
  replicationFactor: 2
  vmstorage:
    replicaCount: 2
    containers:
    - name: my-side-car
      ports:
      - name: extra-port
        containerPort: 8055
    serviceSpec:
      # expose additional port with default service
      userAsDefault: true
      spec:
         ports:
         - name: extra-port
           port: 8055
    storageDataPath: "/vm-data"
    storage:
      volumeClaimTemplate:
        spec:
          resources:
            requests:
              storage: 10Gi
  vmselect:
    replicaCount: 2
    cacheMountPath: "/select-cache"
  vminsert:
    replicaCount: 2
    serviceSpec:
      metadata:
        annotations:
          my-cloud-provide-annotation: value
      userAsDefault: true
      spec:
       type: LoadBalancer

f41gh7 avatar Apr 18 '24 10:04 f41gh7