Endpoints for Services
Okteto creates an HTTPS endpoint for any Service with the dev.okteto.com/auto-ingress: "true" annotation:
apiVersion: v1
kind: Service
metadata:
name: hello-world
labels:
app: hello-world
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: hello-world
See a sample Service manifest with this annotation.
The endpoint forwards traffic to the first HTTP port of your Service, and its hostname is <service-name>-<namespace>.<okteto-subdomain>. You can see the address of your endpoint in the Okteto UI or by running the okteto endpoints command.
Ingress or HTTPRoute
To expose the Service, Okteto creates an Ingress or an HTTPRoute for you, depending on the Helm value unsupported.defaultGateway.type of your Okteto instance: ingress (default) or gateway. You don't need to change your Service when your Okteto instance moves from one to the other.
LoadBalancer and NodePort Services
Okteto manages NodePort and LoadBalancer Services as if they had the dev.okteto.com/auto-ingress: "true" annotation: it converts them to ClusterIP and creates an endpoint for them. You can disable this behavior by setting convertLoadBalancedServices.enabled to false.