Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional TLS spec for RouteGroups #16

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apis/zalando.org/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ type RouteGroupSpec struct {
// Routes describe how a matching HTTP request is handled and where it is forwarded to
// +kubebuilder:validation:MinItems=1
Routes []RouteGroupRouteSpec `json:"routes,omitempty"`
// TLS defines which Kubernetes secret will be used to terminate the connection
// based on the matching hostnames
// +optional
TLS []RouteGroupTLSSpec `json:"tls,omitempty"`
}

// RouteGroupBackendType is the type of the route group backend.
Expand Down Expand Up @@ -168,6 +172,19 @@ type RouteGroupRouteSpec struct {
Methods []HTTPMethod `json:"methods,omitempty"`
}

// +k8s:deepcopy-gen=true
type RouteGroupTLSSpec struct {
// Host specifies the list of hosts included in the TLS secret.
// The values in this list must match the name/s used in the tlsSecret.
rickhlx marked this conversation as resolved.
Show resolved Hide resolved
// +kubebuilder:validation:MinItems=1
Hosts []string `json:"hosts,omitempty"`

// SecretName is the name of the secret used to terminate TLS traffic on port 443.
rickhlx marked this conversation as resolved.
Show resolved Hide resolved
// Field is left optional to allow TLS routing based on SNI hostname alone.
rickhlx marked this conversation as resolved.
Show resolved Hide resolved
// +optional
SecretName string `json:"secretName,omitempty"`
}

// +k8s:deepcopy-gen=true
type RouteGroupStatus struct {
// LoadBalancer is similar to ingress status, such that
Expand Down
28 changes: 28 additions & 0 deletions apis/zalando.org/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions zalando.org_routegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,27 @@ spec:
type: object
minItems: 1
type: array
tls:
description: TLS defines which Kubernetes secret will be used to terminate
the connection based on the matching hostnames
items:
properties:
hosts:
description: Host specifies the list of hosts included in the
TLS secret. The values in this list must match the name/s
used in the tlsSecret.
items:
pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
szuecs marked this conversation as resolved.
Show resolved Hide resolved
type: string
minItems: 1
type: array
secretName:
description: SecretName is the name of the secret used to terminate
TLS traffic on port 443. Field is left optional to allow TLS
routing based on SNI hostname alone.
type: string
type: object
type: array
required:
- backends
type: object
Expand Down
Loading