Custom Endpoints
The Okteto UI shows the endpoints of the Ingress, HTTPRoute, and VirtualService resources deployed in your Namespaces. Okteto supports two annotations on these resources, including your own HTTPRoutes, to customize the endpoints it shows.
Hiding Endpoints
To hide the endpoints of a resource from the Okteto UI, add the dev.okteto.com/hide-from-ui: "true" annotation.
Replacing Endpoints
To replace the default endpoints of a resource, use the dev.okteto.com/endpoints annotation. It accepts a comma-separated list of endpoints and expands the OKTETO_NAMESPACE and OKTETO_DOMAIN variables, so your endpoints stay portable between Namespaces.
- HTTPRoute
- Docker Compose
- Ingress
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: movies
annotations:
dev.okteto.com/endpoints: https://movies-${OKTETO_NAMESPACE}.${OKTETO_DOMAIN}/api
spec:
rules:
- matches:
- path:
type: PathPrefix
value: /api
backendRefs:
- name: api
port: 8080
- backendRefs:
- name: frontend
port: 80
version: "3"
services:
frontend:
build: frontend
ports:
- 80:80
backend:
build: backend
ports:
- 8080
endpoints:
annotations:
dev.okteto.com/endpoints: https://movies-${OKTETO_NAMESPACE}.${OKTETO_DOMAIN}/api
rules:
- path: /
service: frontend
port: 80
- path: /api
service: backend
port: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: movies
annotations:
dev.okteto.com/generate-host: "true"
dev.okteto.com/endpoints: https://movies-${OKTETO_NAMESPACE}.${OKTETO_DOMAIN}/api
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80
- path: /api
pathType: Prefix
backend:
service:
name: api
port:
number: 8080