Service configuration
Configuration for a chart Service resource is configurable at a chart level.
Each chart's Service object shares the same configurable fields e.g. type annotations.
service:
type: ClusterIP
port: 8080
annotations:
custom: annotation
anothercustom: annotation
These fields are used to populate the Service resource at deploy time.
type
The Service type, ClusterIP, LoadBalancer or NodePort.
| Variable | Type | Example |
|---|---|---|
type |
string |
ClusterIP |
port
The Port to expose via the Service.
| Variable | Type | Example |
|---|---|---|
port |
integer |
8080 |
annotations
The annotations field allows a user to append key-value annotations to the Service resource.
| Variable | Type | Example |
|---|---|---|
annotations |
object |
{ "custom": "annotation" } |
useInternalLBAnnotations
Where a Service type has been set to LoadBalancer the cluster will provision a Service resource with an external IP address.
This allows the Service to accessible from outside of the cluster.
service:
type: LoadBalancer
port: 8080
To prevent this annotations may be applied to the Service resource to create an Internal LoadBalancer.
When using an Internal LoadBalancer the Cluster will provision a LoadBalancer Service resource, however it will only be accessible to those within the same virtual network as the Cluster.
service:
type: LoadBalancer
port: 8080
useInternalLBAnnotations: true
These annotations vary between Cluster providers. Setting useInternalLBAnnotations to true will apply all annotations to the Service resource.
By default insights will apply all annotations to a LoadBalancer Service resource. The user is expected to explicitly request that these annotations are not set, if they want the LoadBalancer to be exposed externally.
| Variable | Type | Example | Default |
|---|---|---|---|
useInternalLBAnnotations |
boolean |
false |
true |
apiVersion: v1
kind: Service
metadata:
name: insights-sg-gateway-tcps
annotations:
networking.gke.io/load-balancer-type: Internal
service.beta.kubernetes.io/aws-load-balancer-attributes: load_balancing.cross_zone.enabled=true
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: preserve_client_ip.enabled=false
service.beta.kubernetes.io/aws-load-balancer-type: external
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
Those who know their Cluster provider at deploy time, may wish to use a sub set of these annotations, specific to that provider. This can be done by disabling useInternalLBAnnotations and setting the cluster specific options. See below as to how to set individual annotation options.
Note
These annotations are enabled by default, user must explicitly set false to allow an External LoadBalancer Service
useGKEInternalLBAnnotations
Where the user is aware that Cluster provider is GKE at deploy time, they may choose to only append the relevant annotations.
service:
type: LoadBalancer
port: 8080
useInternalLBAnnotations: false
useGKEInternalLBAnnotations: true
Explicitly setting useInternalLBAnnotations to false and setting useGKEInternalLBAnnotations to true will apply only the GKE annotations.
| Variable | Type | Example | Default |
|---|---|---|---|
useGKEInternalLBAnnotations |
boolean |
true |
false |
apiVersion: v1
kind: Service
metadata:
name: insights-sg-gateway-tcps
annotations:
networking.gke.io/load-balancer-type: Internal
labels:
useAWSInternalLBAnnotations
Where the user is aware that Cluster provider is AWS at deploy time, they may choose to only append the relevant annotations.
service:
type: LoadBalancer
port: 8080
useInternalLBAnnotations: false
useAWSInternalLBAnnotations: true
Explicitly setting useInternalLBAnnotations to false and setting useAWSInternalLBAnnotations to true will apply only the AWS annotations.
| Variable | Type | Example | Default |
|---|---|---|---|
useAWSInternalLBAnnotations |
boolean |
true |
false |
apiVersion: v1
kind: Service
metadata:
name: insights-sg-gateway-tcps
annotations:
service.beta.kubernetes.io/aws-load-balancer-attributes: load_balancing.cross_zone.enabled=true
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: preserve_client_ip.enabled=false
service.beta.kubernetes.io/aws-load-balancer-type: external
labels:
useAKSInternalLBAnnotations
Where the user is aware that Cluster provider is AKS at deploy time, they may choose to only append the relevant annotations.
service:
type: LoadBalancer
port: 8080
useInternalLBAnnotations: false
useAKSInternalLBAnnotations: true
Explicitly setting useInternalLBAnnotations to false and setting useAKSInternalLBAnnotations to true will apply only the AKS annotations.
| Variable | Type | Example | Default |
|---|---|---|---|
useAKSInternalLBAnnotations |
boolean |
true |
false |
apiVersion: v1
kind: Service
metadata:
name: insights-sg-gateway-tcps
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
labels:
Note
Where a chart may be more complex with additional exposed ports or Services, configuration may vary
Global configuration
The insights chart also allows a subset of the local chart service configuration to be set at a global level.
global:
service:
useInternalLBAnnotations: true
useGKEInternalLBAnnotations: true
useAWSInternalLBAnnotations: true
useAKSInternalLBAnnotations: true
Setting useInternalLBAnnotations, useGKEInternalLBAnnotations, useAWSInternalLBAnnotations or useAKSInternalLBAnnotations at a global level, will override those set on a per chart local level.
The annotations applied will be the same as if set at local chart level.