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

First draft of API for isolated clusters #355

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion example/controller-registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ providerConfig:
chart: H4sIAAAAAAAAA+0ca2/cNjKf9SsIpYe2h0j78NoOBORQ13YT3yW2YftSHIoi0Er0rmKtqJKSH03z32/40lurlZ04TSvCgFfUzHBIzgyHw6EWLvVxhKmFbxMcsYBEVkzJdeBD1Qonbjh68uAyhrK7vS3+Q6n+F78nW7PJdHu6s8PrJztb49kTtP3wprtLyhKXIvSEEpKsg+t6/5WWRef87y9dmth37iq8bxt8gndms9b5n27NyvM/harxEzT+lB1tK3/z+Xfj4C2mfN4ddD0x3DjOHs2JPTYNHzOPBnEiqvbQKxyukMdFAl0SipIlRi+VCKE3XF7QqRIflEmUEbkr7KBOUTOuddNjG9o2vvTY/B1Kt/77xLMX5CFtdOn/9tZuxf7vzsbbg/4/RhmNFsRZcAlwE4zYElkeMm17BH/XOPIJHS2CZJnObY+sRlpY8h9L17saaXTLI1FCSRiC7FC8CFgCtSBRNpAtCxWy0TffeW6CZEtvD8/Oj06Ov1eP+NZdxSEetZHjaxHaly9PQzfCjiR6FF1SF6BSL0mprvyZ0CtM5YNpGKMROgWe3QVWVgxH7jzEDJWGIY1joiycqgyihTB2HqEUewnKeUMl3oy4SP3Pb8K69T/BMBkwKuzenmBv/2863hpPB//vMUqf+X+3xGEMS7SdxL18wQ77P5lOdyrzP92ZDvb/UcqHDxby8WUQYWRyN81E1sePRrerxvFgfRDQRpFI6M5xyGxwJO0rfCfJiY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ZOPClSlDC0IWYT4XZ4XL3Etd+XvzBSakBtzi39uVlZkH4Kd2JOJfft192pS65X5rxe8Z1P5wrZtwyj5j44hc8V0wh/3Ro2nT6Eu4XFtJj5MqXTlGcL2wkZM33SZ3yHh1OfXSgBTKxYnDHTk5ZjsoorGFS8NfbVW351RSW2Gl7HW/FWLpm9awD6JqzsHGr1nJNK6kn9fohFCfPlhMpYpROqzDBOhc+WvH3C9aLz3L1+0fqVA4WVX+is3jfPr/LpCX9CXDJXu3Gc37g2dBlW/RW80XYfPLjBLW9B4zb0GU7iOLp7kBXP9Qtwa1w9CdOSWJb/brV+qu9pGpe+lO9YNjdfvQnOz3XDp5OjyGHoP84JFaLTxgnHb9WIj+/yg1APNtl5u1PddBs9wKEMZylCGMpShDGUoQxnKUIYylKEMZShDGcpQhjKUoQylqfwfDhFVpwB4AAA=
values:
image:
tag: v0.21.1
tag: v0.20.20
---
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerRegistration
Expand Down
32 changes: 32 additions & 0 deletions pkg/apis/metal/types_cloudprofile.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package metal

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -66,4 +67,35 @@ const (
type Partition struct {
// FirewallTypes is a list of available firewall machine types in this partition. When empty, allows all values.
FirewallTypes []string

// NetworkIsolation if given allows the creation of shoot clusters which have network restrictions activated.
// Will be taken into account if NetworkAccessRestricted or NetworkAccessForbidden is defined
// +optional
NetworkIsolation *NetworkIsolation
}

type NetworkIsolation struct {
// AllowedNetworks is a list of networks which are allowed to connect in restricted or forbidden NetworkIsolated clusters.
AllowedNetworks []string
// DNSServers
DNSServers []NetworkServer
// NTPServers
NTPServers []NetworkServer
// The registry which serves the images required to create a shoot.
Registry NetworkServer
}

type NetworkServer struct {
// Name describes this server
Name string
// Hostname is typically the dns name of this server
Hostname string
// IP is the ipv4 or ipv6 address of this server
IP string
// IPFamily defines the family of the ip
IPFamily corev1.IPFamily
// Port at which port the service is reachable
Port int32
// Proto the network protocol to reach the service
Proto corev1.Protocol
}
27 changes: 27 additions & 0 deletions pkg/apis/metal/types_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type ControlPlaneConfig struct {

// CustomDefaultStorageClass
CustomDefaultStorageClass *CustomDefaultStorageClass

// NetworkAccessType defines how the cluster can reach external networks.
// +optional
NetworkAccessType *NetworkAccessType
}

// CustomDefaultStorageClass defines the custom storageclass which should be set as default
Expand Down Expand Up @@ -52,6 +56,7 @@ type ControlPlaneFeatures struct {
// RestrictEgress limits the cluster egress to the API server and necessary external dependencies (like container registries)
// by using DNS egress policies.
// Requires firewall-controller >= 1.2.0.
// Deprecated: Will be replaced by NetworkAccessRestricted.
// +optional
RestrictEgress *bool `json:"restrictEgress,omitempty"`
}
Expand All @@ -66,3 +71,25 @@ type CloudControllerManagerConfig struct {
// +optional
DefaultExternalNetwork *string
}

type (
// NetworkAccessType defines how a cluster is capable of accessing external networks
NetworkAccessType string
)

const (
// NetworkAccessBaseline allows the cluster to access external networks in a baseline manner
NetworkAccessBaseline = NetworkAccessType("baseline")
// NetworkAccessRestricted access to external networks is by default restricted to registries, dns and ntp to partition only destinations.
// Therefor registries, dns and ntp destinations must be specified in the cloud-profile accordingly-
// If this is not the case, restricting the access must not be possible.
// Image overrides for all images which are required to create such a shoot, must be specified. No other images are provided in the given registry.
// customers can define own rules to access external networks as in the baseline.
// Service type loadbalancers are also not restricted.
NetworkAccessRestricted = NetworkAccessType("restricted")
// NetworkAccessForbidden in this configuration a customer can no longer create rules to access external networks.
// which are outside of a given list of allowed networks. This is enforced by the firewall.
// Service type loadbalancers are also not possible to open a service ip which is not in the list of allowed networks.
// This is also enforced by the firewall.
NetworkAccessForbidden = NetworkAccessType("baseline")
)
30 changes: 30 additions & 0 deletions pkg/apis/metal/v1alpha1/types_cloudprofile.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -72,4 +73,33 @@ const (
type Partition struct {
// FirewallTypes is a list of available firewall machine types in this partition. When empty, allows all values.
FirewallTypes []string `json:"firewallTypes"`

// NetworkIsolation if given allows the creation of shoot clusters which have network restrictions activated.
NetworkIsolation *NetworkIsolation `json:"networkIsolation,omitempty"`
}

type NetworkIsolation struct {
// AllowedNetworks is a list of networks which are allowed to connect in restricted or forbidden NetworkIsolated clusters.
AllowedNetworks []string `json:"allowedNetworks,omitempty"`
// DNSServers
DNSServers []NetworkServer `json:"dnsServers,omitempty"`
// NTPServers
NTPServers []NetworkServer `json:"ntpServers,omitempty"`
// The registry which serves the images required to create a shoot.
Registry NetworkServer `json:"registry,omitempty"`
}

type NetworkServer struct {
// Name describes this server
Name string `json:"name,omitempty"`
// Hostname is typically the dns name of this server
Hostname string `json:"hostname,omitempty"`
// IP is the ipv4 or ipv6 address of this server
IP string `json:"ip,omitempty"`
// IPFamily defines the family of the ip
IPFamily corev1.IPFamily `json:"ipfamily,omitempty"`
// Port at which port the service is reachable
Port int32 `json:"port,omitempty"`
// Proto the network protocol to reach the service
Proto corev1.Protocol `json:"proto,omitempty"`
}
25 changes: 25 additions & 0 deletions pkg/apis/metal/v1alpha1/types_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type ControlPlaneConfig struct {

// CustomDefaultStorageClass
CustomDefaultStorageClass *CustomDefaultStorageClass `json:"customDefaultStorageClass,omitempty"`

// NetworkAccessType defines how the cluster can reach external networks.
// +optional
NetworkAccessType *NetworkAccessType `json:"networkAccessType,omitempty"`
}

// CustomDefaultStorageClass defines the custom storageclass which should be set as default
Expand Down Expand Up @@ -67,3 +71,24 @@ type CloudControllerManagerConfig struct {
// +optional
DefaultExternalNetwork *string `json:"defaultExternalNetwork" optional:"true"`
}
type (
// NetworkAccessType defines how a cluster is capable of accessing external networks
NetworkAccessType string
)

const (
// NetworkAccessBaseline allows the cluster to access external networks in a baseline manner
NetworkAccessBaseline = NetworkAccessType("baseline")
// NetworkAccessRestricted access to external networks is by default restricted to registries, dns and ntp to partition only destinations.
// Therefor registries, dns and ntp destinations must be specified in the cloud-profile accordingly-
// If this is not the case, restricting the access must not be possible.
// Image overrides for all images which are required to create such a shoot, must be specified. No other images are provided in the given registry.
// customers can define own rules to access external networks as in the baseline.
// Service type loadbalancers are also not restricted.
NetworkAccessRestricted = NetworkAccessType("restricted")
// NetworkAccessForbidden in this configuration a customer can no longer create rules to access external networks.
// which are outside of a given list of allowed networks. This is enforced by the firewall.
// Service type loadbalancers are also not possible to open a service ip which is not in the list of allowed networks.
// This is also enforced by the firewall.
NetworkAccessForbidden = NetworkAccessType("baseline")
)
85 changes: 85 additions & 0 deletions pkg/apis/metal/v1alpha1/zz_generated.conversion.go

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

Loading