v1alpha1

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Group   = "api-gateway.consul.hashicorp.com"
	Version = "v1alpha1"
)
View Source
const (
	GatewayClassConfigKind = "GatewayClassConfig"
	MeshServiceKind        = "MeshService"
)

Variables

Functions

func MergeDeployment

func MergeDeployment(a, b *appsv1.Deployment, currentReplicas *int32) *appsv1.Deployment

MergeDeployment merges a gateway deployment a onto b and returns b, overriding all of the fields that we'd normally set for a service deployment. It does not attempt to change the service type

func MergeService

func MergeService(a, b *corev1.Service) *corev1.Service

MergeService merges a gateway service a onto b and returns b, overriding all of the fields that we'd normally set for a service deployment. It does not attempt to change the service type

func RegisterTypes

func RegisterTypes(scheme *runtime.Scheme)

Types

type AuthSpec

type AuthSpec struct {
	// Whether deployments should be run with "managed" service accounts created by the gateway controller.
	Managed bool `json:"managed,omitempty"`
	// The Consul auth method used for initial authentication by consul-api-gateway.
	Method string `json:"method,omitempty"`
	// The Kubernetes service account to authenticate as.
	Account string `json:"account,omitempty"`
	// The Consul namespace to use for authentication.
	Namespace string `json:"namespace,omitempty"`
}

type ConsulSpec

type ConsulSpec struct {
	// Consul authentication information
	AuthSpec AuthSpec `json:"authentication,omitempty"`
	// The scheme to use for connecting to Consul.
	// +kubebuilder:validation:Enum=http;https
	Scheme string `json:"scheme,omitempty"`
	// The address of the consul server to communicate with in the gateway
	// pod. If not specified, the pod will attempt to use a local agent on
	// the host on which it is running.
	Address string `json:"address,omitempty"`
	// The information about Consul's ports
	PortSpec PortSpec `json:"ports,omitempty"`
}

type CopyAnnotationsSpec

type CopyAnnotationsSpec struct {
	// List of annotations to copy to the gateway service.
	Service []string `json:"service,omitempty"`
}

func (*CopyAnnotationsSpec) DeepCopy

func (in *CopyAnnotationsSpec) DeepCopy() *CopyAnnotationsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CopyAnnotationsSpec.

func (*CopyAnnotationsSpec) DeepCopyInto

func (in *CopyAnnotationsSpec) DeepCopyInto(out *CopyAnnotationsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeploymentSpec added in v0.3.0

type DeploymentSpec struct {
	// +kubebuilder:default:=1
	// +kubebuilder:validation:Maximum=8
	// +kubebuilder:validation:Minimum=1
	// Number of gateway instances that should be deployed by default
	DefaultInstances *int32 `json:"defaultInstances,omitempty"`
	// +kubebuilder:default:=8
	// +kubebuilder:validation:Maximum=8
	// +kubebuilder:validation:Minimum=1
	// Max allowed number of gateway instances
	MaxInstances *int32 `json:"maxInstances,omitempty"`
	// +kubebuilder:default:=1
	// +kubebuilder:validation:Maximum=8
	// +kubebuilder:validation:Minimum=1
	// Minimum allowed number of gateway instances
	MinInstances *int32 `json:"minInstances,omitempty"`
}

func (*DeploymentSpec) DeepCopy added in v0.3.0

func (in *DeploymentSpec) DeepCopy() *DeploymentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpec.

func (*DeploymentSpec) DeepCopyInto added in v0.3.0

func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GatewayClassConfig

type GatewayClassConfig struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired state of GatewayClassConfig.
	Spec GatewayClassConfigSpec `json:"spec,omitempty"`
}

GatewayClassConfig describes the configuration of a consul-api-gateway GatewayClass.

func (*GatewayClassConfig) DeepCopy

func (in *GatewayClassConfig) DeepCopy() *GatewayClassConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClassConfig.

func (*GatewayClassConfig) DeepCopyInto

func (in *GatewayClassConfig) DeepCopyInto(out *GatewayClassConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayClassConfig) DeepCopyObject

func (in *GatewayClassConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GatewayClassConfig) ServiceAccountFor

func (c *GatewayClassConfig) ServiceAccountFor(gw *gwv1beta1.Gateway) *corev1.ServiceAccount

ServicesAccountFor returns the service account to be created for the given gateway.

type GatewayClassConfigList

type GatewayClassConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []GatewayClassConfig `json:"items"`
}

GatewayClassConfigList is a list of Config resources.

func (*GatewayClassConfigList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClassConfigList.

func (*GatewayClassConfigList) DeepCopyInto

func (in *GatewayClassConfigList) DeepCopyInto(out *GatewayClassConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayClassConfigList) DeepCopyObject

func (in *GatewayClassConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GatewayClassConfigSpec

type GatewayClassConfigSpec struct {
	// +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer
	ServiceType *corev1.ServiceType `json:"serviceType,omitempty"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If this is set, then the Envoy container ports are mapped
	// to host ports.
	UseHostPorts bool `json:"useHostPorts,omitempty"`
	// Configuration information about connecting to Consul.
	ConsulSpec ConsulSpec `json:"consul,omitempty"`
	// Configuration information about the images to use
	ImageSpec ImageSpec `json:"image,omitempty"`
	// Annotation Information to copy to services or deployments
	CopyAnnotations CopyAnnotationsSpec `json:"copyAnnotations,omitempty"`
	// +kubebuilder:validation:Enum=trace;debug;info;warning;error
	// Logging levels
	LogLevel string `json:"logLevel,omitempty"`
	// Configuration information about how many instances to deploy
	DeploymentSpec DeploymentSpec `json:"deployment,omitempty"`
}

GatewayClassConfigSpec specifies the 'spec' of the Config CRD.

func (*GatewayClassConfigSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClassConfigSpec.

func (*GatewayClassConfigSpec) DeepCopyInto

func (in *GatewayClassConfigSpec) DeepCopyInto(out *GatewayClassConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageSpec

type ImageSpec struct {
	// The image to use for consul-api-gateway.
	ConsulAPIGateway string `json:"consulAPIGateway,omitempty"`
	// The image to use for Envoy.
	Envoy string `json:"envoy,omitempty"`
}

type MeshService

type MeshService struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired state of MeshService.
	Spec MeshServiceSpec `json:"spec,omitempty"`
}

MeshService holds a reference to an externally managed Consul Service Mesh service.

func (*MeshService) DeepCopy

func (in *MeshService) DeepCopy() *MeshService

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshService.

func (*MeshService) DeepCopyInto

func (in *MeshService) DeepCopyInto(out *MeshService)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MeshService) DeepCopyObject

func (in *MeshService) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MeshServiceList

type MeshServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []MeshService `json:"items"`
}

MeshServiceList is a list of MeshService resources.

func (*MeshServiceList) DeepCopy

func (in *MeshServiceList) DeepCopy() *MeshServiceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshServiceList.

func (*MeshServiceList) DeepCopyInto

func (in *MeshServiceList) DeepCopyInto(out *MeshServiceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MeshServiceList) DeepCopyObject

func (in *MeshServiceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MeshServiceSpec

type MeshServiceSpec struct {
	// Name holds the service name for a Consul service.
	Name string `json:"name,omitempty"`
}

MeshServiceSpec specifies the 'spec' of the MeshService CRD.

func (*MeshServiceSpec) DeepCopy

func (in *MeshServiceSpec) DeepCopy() *MeshServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshServiceSpec.

func (*MeshServiceSpec) DeepCopyInto

func (in *MeshServiceSpec) DeepCopyInto(out *MeshServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PortSpec

type PortSpec struct {
	// The port for Consul's HTTP server.
	HTTP int `json:"http,omitempty"`
	// The grpc port for Consul's xDS server.
	GRPC int `json:"grpc,omitempty"`
}

Jump to

Keyboard shortcuts

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