ingress_routes

package
v1.12.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

Ingress Routes Plugin

The rigdev.ingress_routes plugin handles the routes by creating an Ingress resource for each route. The Ingress resource is created with the annotations specified in the RouteOptions, with the class specified in the ingressClassName field in the config, and has tls specified if the disableTLS field is not set to true. Furthermore, the plugin will create a Certificate resource for the route hosts if the createCertificateResources field is set to true and a clusterIssuer is specified in the clusterIssuer field.

Example

Config:

config:
  pipeline:
    routesStep:
      plugin: "rigdev.ingress_routes"
      config: |
        clusterIssuer: letsencrypt-prod
        createCertificateResources: true
        ingressClassName: nginx
        disableTLS: false
        annotations:
          my-annotation: "my-value"

ALB Ingress Controller

If using The ALB Ingress Controller with target-type=instance, an additional service with the suffix alb is automatically created. This is done as the traffic is routed to NodePorts and then proxied to the pods. instance is The default type, but can be changed to ip if the annotation alb.ingress.kubernetes.io/target-type: ip is set.

Nginx Ingress Controller

When using the Nginx Ingress Controller, it is possible to use rewrite-targets. This is done by setting the annotation nginx.ingress.kubernetes.io/rewrite-target: / to the desired URI.

If the path-type is set to RegularExpression, the annotation nginx.ingress.kubernetes.io/use-regex: "true" is automatically set.

Config

Configuration for the ingress_routes plugin

Field Description
clusterIssuer string ClusterIssuer to use for issueing ingress certificates
createCertificateResources boolean CreateCertificateResources specifies wether to create Certificate
resources. If this is not enabled we will use ingress annotations. This
is handy in environments where the ingress-shim isn't enabled.
ingressClassName string ClassName specifies the default ingress class to use for all ingress
resources created.
disableTLS boolean DisableTLS for ingress resources generated. This is useful if a 3rd-party component
is handling the HTTPS TLS termination and certificates.
annotations object (keys:string, values:string) Annotations to be added to all ingress resources created.

Documentation

Overview

+groupName=plugins.rig.dev -- Only used for config doc generation

Index

Constants

View Source
const AnnotationImplementationSpecificPathType = "plugin.rig.dev/implementation-specific-path-type"
View Source
const Name = "rigdev.ingress_routes"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ClusterIssuer to use for issueing ingress certificates
	ClusterIssuer string `json:"clusterIssuer,omitempty"`

	// CreateCertificateResources specifies wether to create Certificate
	// resources. If this is not enabled we will use ingress annotations. This
	// is handy in environments where the ingress-shim isn't enabled.
	CreateCertificateResources bool `json:"createCertificateResources,omitempty"`

	// ClassName specifies the default ingress class to use for all ingress
	// resources created.
	IngressClassName string `json:"ingressClassName,omitempty"`

	// DisableTLS for ingress resources generated. This is useful if a 3rd-party component
	// is handling the HTTPS TLS termination and certificates.
	DisableTLS bool `json:"disableTLS,omitempty"`

	// Annotations to be added to all ingress resources created.
	Annotations map[string]string `json:"annotations,omitempty"`
}

Configuration for the ingress_routes plugin +kubebuilder:object:root=true

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) ComputeConfig added in v1.12.0

func (p *Plugin) ComputeConfig(ctx context.Context, req pipeline.CapsuleRequest, logger hclog.Logger) (string, error)

func (*Plugin) Initialize

func (p *Plugin) Initialize(req plugin.InitializeRequest) error

func (*Plugin) Run

func (p *Plugin) Run(_ context.Context, req pipeline.CapsuleRequest, _ hclog.Logger) error

func (*Plugin) WatchObjectStatus

func (p *Plugin) WatchObjectStatus(ctx context.Context, watcher plugin.CapsuleWatcher) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL