Skip to content

Ports

Appears in

  • .Values.service.$name.ports

Target Selector

  • targetSelector (string): Define the container to link the port
  • targetSelector (empty): Assign the service to the primary container

$port-name

Define the port dict

Keyservice.$name.ports.$port-name
Typemap
Required
Helm tpl
Default{}

Example

service:
service-name:
ports:
port-name: {}

port

Define the port that will be exposed by the service

Keyservice.$name.ports.$port-name.port
Typeint
Required
Helm tpl
Defaultunset

Example

service:
service-name:
ports:
port-name:
port: 80

targetPort

Define the target port (No named ports)

Keyservice.$name.ports.$port-name.targetPort
Typeint
Required
Helm tpl
Default(Defaults to port if not set)

Example

service:
service-name:
ports:
port-name:
targetPort: 80

protocol

Define the port protocol Used by the container ports and probes, http and https are converted to tcp where needed

Keyservice.$name.ports.$port-name.protocol
Typestring
Required
Helm tpl
DefaultSee default here

Valid Values:

  • tcp
  • udp
  • http
  • https

Example

service:
service-name:
ports:
port-name:
protocol: tcp

hostPort

Define the hostPort, should be avoided, unless ABSOLUTELY necessary

Keyservice.$name.ports.$port-name.hostPort
Typeint
Required
Helm tpl
Defaultunset

Example

service:
service-name:
ports:
port-name:
hostPort: 30000

targetSelector

Define the container to link this port (Must be on under the pod linked above)

Keyservice.$name.ports.$port-name.targetSelector
Typestring
Required
Helm tpl
Defaultunset

Example

service:
service-name:
ports:
port-name:
targetSelector: some-container

Full Examples

Full examples can be found under each service type