Service IP

This module helps to retrieve the domain, IP, and ports of a Kubernetes service.

If service ends up being null, all the outputs of the module will be null as well.

If service is an headless service, the ip output will be null. You can use the host output to have the IP of the service if it exists, or the domain name of the service otherwise.

Requirements

Name

Version

terraform

>= 1.0

Providers

No providers.

Modules

No modules.

Resources

No resources.

Inputs

Name

Description

Type

Default

Required

cluster_domain

Internal domain name of the Kubernetes cluster

string

null

no

service

Service object

any

n/a

yes

Outputs

Name

Description

domain

Domain Name of the service

fqdn

Fully Qualified Domain Name (FQDN) of the service

host

Either the IP or the FQDN of the service

ip

IP of the service

ports

Ports of the service

ports_map

Map of ports of the service with port name as key and exposed port number as value

Example