To expose a service, only the omni-kube-service-exposer.sidero.dev/port annotation is required.
Its value must be a port that is unused on the nodes, such as by other exposed Services.
The annotation omni-kube-service-exposer.sidero.dev/label can be set to a human-friendly name to be displayed on the Omni Web left menu.
If not set, the default name of <service-name>.<service-namespace> will be used.
The annotation omni-kube-service-exposer.sidero.dev/prefix can be set to use a user-defined prefix instead of a randomly-generated alphanumeric string as a prefix in the URL.
The annotation omni-kube-service-exposer.sidero.dev/icon can be set to render an icon for this service on the Omni Web left menu.
If set, valid values are:
Either a base64-encoded SVG
Or a base64-encoded GZIP of an SVG
To encode an SVG file icon.svg to be used for the annotation, you can use the following command:
gzip -c icon.svg | base64
Accessing the Exposed Service
You will notice that the Service you annotated will appear under the “Exposed Services” section in Omni Web, on the left menu when the cluster is selected.
Clicking it will open the exposed service in Omni.
The URL will either contain a randomly-generated alphanumeric prefix, or the user-defined prefix if the omni-kube-service-exposer.sidero.dev/prefix annotation was set.
This feature only works with HTTP services. Raw TCP or UDP are not supported.
The services are only accessible to users authenticated to Omni and that have at leastReaderlevel access to the cluster containing the Service.
Troubleshooting
You can get more info and troubleshoot the exposed services by running the following command:
omnictl get exposedservices
You will get an output like:
NAMESPACE TYPE ID VERSION PORT LABEL URL ERROR HAS EXPLICIT ALIAS
default ExposedService talos-default/nginx-1.default 2 12345 nginx https://myservice1-omni.<omni-url> true
default ExposedService talos-default/nginx-2.default 2 12346 nginx2 https://myservice2-omni.<omni-url> true
default ExposedService talos-default/nginx-3.default 2 0 requested alias "myservice2" is already used by another service false
Inspect the output to get information about the status of your exposed service.