Skip to content

Commit

Permalink
feature: loadbalancerclass (#1545)
Browse files Browse the repository at this point in the history
**Description of the change**

This allows to specify a loadbalancerclass on the created services.
From the kubernetes docs: 

> For a Service with type set to LoadBalancer, the
.spec.loadBalancerClass field enables you to use a load balancer
implementation other than the cloud provider default.
> 
> By default, .spec.loadBalancerClass is not set and a LoadBalancer type
of Service uses the cloud provider's default load balancer
implementation if the cluster is configured with a cloud provider using
the --cloud-provider component flag.
> 
> If you specify .spec.loadBalancerClass, it is assumed that a load
balancer implementation that matches the specified class is watching for
Services. Any default load balancer implementation (for example, the one
provided by the cloud provider) will ignore Services that have this
field set. spec.loadBalancerClass can be set on a Service of type
LoadBalancer only. Once set, it cannot be changed. The value of
spec.loadBalancerClass must be a label-style identifier, with an
optional prefix such as "internal-vip" or "example.com/internal-vip".
Unprefixed names are reserved for end-users.

---------

Signed-off-by: Matthias Teich <matthiasteich83@gmail.com>
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
  • Loading branch information
Mattes83 authored Jun 20, 2024
1 parent a7edcbb commit d505bcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helm/sealed-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ The command removes all the Kubernetes components associated with the chart and
| Name | Description | Value |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `service.type` | Sealed Secret service type | `ClusterIP` |
| `service.loadBalancerClass` | Sealed Secret service loadBalancerClass | `` |
| `service.port` | Sealed Secret service HTTP port | `8080` |
| `service.nodePort` | Node port for HTTP | `""` |
| `service.annotations` | Additional custom annotations for Sealed Secret service | `{}` |
Expand Down Expand Up @@ -213,6 +214,7 @@ The command removes all the Kubernetes components associated with the chart and
| `metrics.dashboards.annotations` | Annotations to be added to the Grafana dashboard ConfigMap | `{}` |
| `metrics.dashboards.namespace` | Namespace where Grafana dashboard ConfigMap is deployed | `""` |
| `metrics.service.type` | Sealed Secret Metrics service type | `ClusterIP` |
| `metrics.service.loadBalancerClass` | Sealed Secret service Metrics loadBalancerClass | `` |
| `metrics.service.port` | Sealed Secret service Metrics HTTP port | `8081` |
| `metrics.service.nodePort` | Node port for HTTP | `""` |
| `metrics.service.annotations` | Additional custom annotations for Sealed Secret Metrics service | `{}` |
Expand Down
6 changes: 6 additions & 0 deletions helm/sealed-secrets/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- with .Values.service.loadBalancerClass }}
loadBalancerClass: {{ . }}
{{- end }}
ports:
- name: http
port: {{ .Values.service.port }}
Expand Down Expand Up @@ -57,6 +60,9 @@ metadata:
app.kubernetes.io/component: metrics
spec:
type: {{ .Values.metrics.service.type }}
{{- with .Values.metrics.service.loadBalancerClass }}
loadBalancerClass: {{ . }}
{{- end }}
ports:
- name: metrics
port: {{ .Values.metrics.service.port }}
Expand Down
6 changes: 6 additions & 0 deletions helm/sealed-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ service:
## @param service.type Sealed Secret service type
##
type: ClusterIP
## @param service.loadBalancerClass Sealed Secret service loadBalancerClass
##
loadBalancerClass: ""
## @param service.port Sealed Secret service HTTP port
##
port: 8080
Expand Down Expand Up @@ -482,6 +485,9 @@ metrics:
## @param metrics.service.type Sealed Secret Metrics service type
##
type: ClusterIP
## @param metrics.service.loadBalancerClass Sealed Secret Metrics service loadBalancerClass
##
loadBalancerClass: ""
## @param metrics.service.port Sealed Secret service Metrics HTTP port
##
port: 8081
Expand Down

0 comments on commit d505bcb

Please sign in to comment.