Skip to content

Support service labels #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions config/crd/bases/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,16 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations store Kubernetes Service annotations.
description: |-
Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).
type: object
labels:
additionalProperties:
type: string
description: |-
Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.
type: object
loadBalancerIP:
description: |-
Expand Down Expand Up @@ -7697,7 +7706,16 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations store Kubernetes Service annotations.
description: |-
Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).
type: object
labels:
additionalProperties:
type: string
description: |-
Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.
type: object
loadBalancerIP:
description: |-
Expand Down Expand Up @@ -10526,7 +10544,16 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations store Kubernetes Service annotations.
description: |-
Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).
type: object
labels:
additionalProperties:
type: string
description: |-
Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.
type: object
loadBalancerIP:
description: |-
Expand Down Expand Up @@ -13550,7 +13577,16 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations store Kubernetes Service annotations.
description: |-
Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).
type: object
labels:
additionalProperties:
type: string
description: |-
Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.
type: object
loadBalancerIP:
description: |-
Expand Down
11 changes: 10 additions & 1 deletion config/crd/bases/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3317,7 +3317,16 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations store Kubernetes Service annotations.
description: |-
Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).
type: object
labels:
additionalProperties:
type: string
description: |-
Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.
type: object
loadBalancerIP:
description: |-
Expand Down
16 changes: 16 additions & 0 deletions deploy/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,10 @@ spec:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
loadBalancerSourceRanges:
Expand Down Expand Up @@ -3684,6 +3688,10 @@ spec:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
loadBalancerSourceRanges:
Expand Down Expand Up @@ -4987,6 +4995,10 @@ spec:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
loadBalancerSourceRanges:
Expand Down Expand Up @@ -6389,6 +6401,10 @@ spec:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
loadBalancerSourceRanges:
Expand Down
4 changes: 4 additions & 0 deletions deploy/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,10 @@ spec:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
loadBalancerIP:
type: string
loadBalancerSourceRanges:
Expand Down
18 changes: 16 additions & 2 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,21 @@ map[string]string
</td>
<td>
<em>(Optional)</em>
<p>Annotations store Kubernetes Service annotations.</p>
<p>Annotations store Kubernetes Service annotations. These will be added to the external service
only (not internal).</p>
</td>
</tr>
<tr>
<td>
<code>labels</code><br/>
<em>
map[string]string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Labels store Kubernetes Service labels. These will be added to the external service only (not
internal). StarRocks may add its own default labels.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -2509,5 +2523,5 @@ AutoScalingPolicy
<hr/>
<p><em>
Generated with <code>gen-crd-api-reference-docs</code>
on git commit <code>42e17ab</code>.
on git commit <code>dbe00d8</code>.
</em></p>
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ spec:
{{- toYaml .Values.starrocksFESpec.service.annotations | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.starrocksFESpec.service.labels}}
labels:
{{- toYaml .Values.starrocksFESpec.service.labels | nindent 8 }}
{{- end }}
{{- end }}
annotations:
app.starrocks.io/fe-config-hash: "{{template "starrockscluster.fe.config.hash" . }}"
Expand Down Expand Up @@ -326,6 +330,10 @@ spec:
{{- toYaml .Values.starrocksBeSpec.service.annotations | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.starrocksBeSpec.service.labels}}
labels:
{{- toYaml .Values.starrocksBeSpec.service.labels | nindent 8 }}
{{- end }}
{{- end }}
annotations:
app.starrocks.io/be-config-hash: "{{template "starrockscluster.be.config.hash" . }}"
Expand Down Expand Up @@ -751,6 +759,10 @@ spec:
{{- toYaml .Values.starrocksCnSpec.service.annotations | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCnSpec.service.labels}}
labels:
{{- toYaml .Values.starrocksCnSpec.service.labels | nindent 8 }}
{{- end }}
{{- end }}
annotations:
app.starrocks.io/cn-config-hash: "{{template "starrockscluster.cn.config.hash" . }}"
Expand Down Expand Up @@ -875,6 +887,10 @@ spec:
annotations:
{{- toYaml .Values.starrocksFeProxySpec.service.annotations | nindent 8 }}
{{- end }}
{{- if .Values.starrocksFeProxySpec.service.labels}}
labels:
{{- toYaml .Values.starrocksFeProxySpec.service.labels | nindent 8 }}
{{- end }}
{{- if and (eq "LoadBalancer" .Values.starrocksFeProxySpec.service.type) .Values.starrocksFeProxySpec.service.loadbalancerIP }}
loadBalancerIP: {{ .Values.starrocksFeProxySpec.service.loadbalancerIP }}
{{- end }}
Expand Down
16 changes: 12 additions & 4 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ starrocksFESpec:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for fe service.
# add annotations for external fe service.
annotations: {}
# Add labels for external fe service. The operator may add its own default labels.
labels: {}
# config the service port for fe service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -490,8 +492,10 @@ starrocksCnSpec:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadBalancerIp is not empty.
loadbalancerIP: ""
# add annotations for cn service.
# add annotations for external cn service.
annotations: {}
# Add labels for external cn service. The operator may add its own default labels.
labels: {}
# config the service port for cn service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -825,8 +829,10 @@ starrocksBeSpec:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for be service.
# add annotations for external be service.
annotations: {}
# Add labels for external be service. The operator may add its own default labels.
labels: {}
# config the service port for be service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -1134,8 +1140,10 @@ starrocksFeProxySpec:
type: ClusterIP
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for fe service.
# add annotations for external fe proxy service.
annotations: {}
# Add labels for external fe proxy service. The operator may add its own default labels.
labels: {}
# config the service port for fe proxy service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down
16 changes: 12 additions & 4 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,10 @@ starrocks:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for fe service.
# add annotations for external fe service.
annotations: {}
# Add labels for external fe service. The operator may add its own default labels.
labels: {}
# config the service port for fe service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -602,8 +604,10 @@ starrocks:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadBalancerIp is not empty.
loadbalancerIP: ""
# add annotations for cn service.
# add annotations for external cn service.
annotations: {}
# Add labels for external cn service. The operator may add its own default labels.
labels: {}
# config the service port for cn service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -937,8 +941,10 @@ starrocks:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for be service.
# add annotations for external be service.
annotations: {}
# Add labels for external be service. The operator may add its own default labels.
labels: {}
# config the service port for be service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down Expand Up @@ -1246,8 +1252,10 @@ starrocks:
type: ClusterIP
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty.
loadbalancerIP: ""
# add annotations for fe service.
# add annotations for external fe proxy service.
annotations: {}
# Add labels for external fe proxy service. The operator may add its own default labels.
labels: {}
# config the service port for fe proxy service.
# To assign a specific port or nodePort to a service, you should specify them by the corresponding name or
# containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ spec:
{{- toYaml .Values.spec.service.annotations | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.spec.service.labels }}
labels:
{{- toYaml .Values.spec.service.labels | nindent 8 }}
{{- end }}
{{- end }}
annotations:
app.starrocks.io/cn-config-hash: "{{template "starrockswarehouse.config.hash" . }}"
Expand Down
4 changes: 3 additions & 1 deletion helm-charts/charts/warehouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ spec:
type: "ClusterIP"
# the loadBalancerIP for static ip config when the type=LoadBalancer and loadBalancerIp is not empty.
loadbalancerIP: ""
# add annotations for service.
# add annotations for external service.
annotations: {}
# add labels for external service.
labels: {}
# config the service port for service.
# if you want to use a dedicated port for service, you can config the port.
# see https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports for more details.
Expand Down
8 changes: 7 additions & 1 deletion pkg/apis/starrocks/v1/load_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ type StarRocksLoadSpec struct {

// StarRocksService defines external service for starrocks component.
type StarRocksService struct {
// Annotations store Kubernetes Service annotations.
// Annotations store Kubernetes Service annotations. These will be added to the external service
// only (not internal).
// +optional
Annotations map[string]string `json:"annotations,omitempty"`

// Labels store Kubernetes Service labels. These will be added to the external service only (not
// internal). StarRocks may add its own default labels.
// +optional
Labels map[string]string `json:"labels,omitempty"`

// type of service,the possible value for the service type are : ClusterIP, NodePort, LoadBalancer,ExternalName.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
// +optional
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/starrocks/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading