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 all commits
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 {
// TLS hosts specify the list of hosts included in the TLS secret.
// The values in this list must match the host name(s) used for
// the RouteGroup in order to terminate TLS for the host(s).
// +kubebuilder:validation:MinItems=1
Hosts []string `json:"hosts"`

// SecretName is the name of the secret used to terminate TLS traffic.
// Secret should reside in the same namespace as the RouteGroup.
SecretName string `json:"secretName"`
}

// +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.

25 changes: 25 additions & 0 deletions zalando.org_routegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,31 @@ 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: TLS hosts specify the list of hosts included in
the TLS secret. The values in this list must match the host
name(s) used for the RouteGroup in order to terminate TLS
for the host(s).
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. Secret should reside in the same namespace as
the RouteGroup.
type: string
required:
- hosts
- secretName
type: object
type: array
required:
- backends
type: object
Expand Down
Loading