Documentation ¶
Index ¶
Constants ¶
const ( EndpointTypePassthrough = "EndpointTypePassthrough" EndpointTypeInsecureEdge = "EndpointTypeInsecureEdge" InsecureEdgeTerminationPolicyPort = 8080 TLSTerminationPassthroughPolicyPort = 6443 )
Variables ¶
var IngressPort int32 = 443
Functions ¶
func APIsToWatch ¶
APIsToWatch give a list of APIs to watch if using this package to deploy the endpoint. The error can be checked as follows to determine if the package is not usable with the given kube apiserver
noResourceError := &metaapi.NoResourceMatchError{} if errors.As(err, &noResourceError) { }
func AddToScheme ¶
AddToScheme should be used as soon as scheme is created to add route objects for encoding/decoding
func New ¶
func New(ctx context.Context, c client.Client, logger logr.Logger, namespacedName types.NamespacedName, eType EndpointType, hostname *string, labels map[string]string, ownerReferences []metav1.OwnerReference) (endpoint.Endpoint, error)
New creates the route endpoint object, deploys the resource on the cluster and then checks for the health of the route. Before using the fields of the route it is always recommended to check if the route is healthy.
In order to identify if the route API exists check for the following error after calling New() noResourceError := &metaapi.NoResourceMatchError{}
switch { case errors.As(err, &noResourceError): // log route is not available, reconcilers should not requeue at this point log.Info("route.openshift.io is unavailable, route endpoint will be disabled") }
In order to generate the right RBAC, add the following lines to the Reconcile function annotations. +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
Types ¶
type EndpointType ¶
type EndpointType string