-
Notifications
You must be signed in to change notification settings - Fork 79
/
types_cloudprofile.go
147 lines (133 loc) · 5.9 KB
/
types_cloudprofile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package openstack
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// CloudProfileConfig contains provider-specific configuration that is embedded into Gardener's `CloudProfile`
// resource.
type CloudProfileConfig struct {
metav1.TypeMeta
// Constraints is an object containing constraints for certain values in the control plane config.
Constraints Constraints
// DNSServers is a list of IPs of DNS servers used while creating subnets.
DNSServers []string
// DHCPDomain is the dhcp domain of the OpenStack system configured in nova.conf. Only meaningful for
// Kubernetes 1.10.1+. See https://github.com/kubernetes/kubernetes/pull/61890 for details.
DHCPDomain *string
// KeyStoneURL is the URL for auth{n,z} in OpenStack (pointing to KeyStone).
KeyStoneURL string
// KeyStoneURLs is a region-URL mapping for auth{n,z} in OpenStack (pointing to KeyStone).
KeyStoneURLs []KeyStoneURL
// MachineImages is the list of machine images that are understood by the controller. It maps
// logical names and versions to provider-specific identifiers.
MachineImages []MachineImages
// RequestTimeout specifies the HTTP timeout against the OpenStack API.
RequestTimeout *string
// RescanBlockStorageOnResize specifies whether the storage plugin scans and checks new block device size before it resizes
// the filesystem.
RescanBlockStorageOnResize *bool
// NodeVolumeAttachLimit specifies how many volumes can be attached to a node.
NodeVolumeAttachLimit *int32
// UseOctavia specifies whether the OpenStack Octavia network load balancing is used.
UseOctavia *bool
// UseSNAT specifies whether S-NAT is supposed to be used for the Gardener managed OpenStack router.
UseSNAT *bool
// ServerGroupPolicies specify the allowed server group policies for worker groups.
ServerGroupPolicies []string
}
// Constraints is an object containing constraints for the shoots.
type Constraints struct {
// FloatingPools contains constraints regarding allowed values of the 'floatingPoolName' block in the control plane config.
FloatingPools []FloatingPool
// LoadBalancerProviders contains constraints regarding allowed values of the 'loadBalancerProvider' block in the control plane config.
LoadBalancerProviders []LoadBalancerProvider
}
// FloatingPool contains constraints regarding allowed values of the 'floatingPoolName' block in the control plane config.
type FloatingPool struct {
// Name is the name of the floating pool.
Name string
// Region is the region name.
Region *string
// Domain is the domain name.
Domain *string
// NonConstraining specifies whether this floating pool is not constraining, that means additionally available independent of other FP constraints.
NonConstraining *bool
// LoadBalancerClasses contains a list of supported labeled load balancer network settings.
LoadBalancerClasses []LoadBalancerClass
}
// KeyStoneURL is a region-URL mapping for auth{n,z} in OpenStack (pointing to KeyStone).
type KeyStoneURL struct {
// Region is the name of the region.
Region string
// URL is the keystone URL.
URL string
}
// LoadBalancerClass defines a restricted network setting for generic LoadBalancer classes.
type LoadBalancerClass struct {
// Name is the name of the LB class
Name string
// FloatingSubnetID is the subnetwork ID of a dedicated subnet in floating network pool.
FloatingSubnetID *string
// FloatingNetworkID is the network ID of the floating network pool.
FloatingNetworkID *string
// SubnetID is the ID of a local subnet used for LoadBalancer provisioning. Only usable if no FloatingPool
// configuration is done.
SubnetID *string
}
func (in LoadBalancerClass) String() string {
result := fmt.Sprintf("Name: %q", in.Name)
if in.FloatingSubnetID != nil {
result += fmt.Sprintf(", FloatingSubnetID: %q", *in.FloatingSubnetID)
}
if in.FloatingNetworkID != nil {
result += fmt.Sprintf(", FloatingNetworkID: %q", *in.FloatingNetworkID)
}
if in.SubnetID != nil {
result += fmt.Sprintf(", SubnetID: %q", *in.SubnetID)
}
return result
}
// LoadBalancerProvider contains constraints regarding allowed values of the 'loadBalancerProvider' block in the control plane config.
type LoadBalancerProvider struct {
// Name is the name of the load balancer provider.
Name string
// Region is the region name.
Region *string
}
// MachineImages is a mapping from logical names and versions to provider-specific identifiers.
type MachineImages struct {
// Name is the logical name of the machine image.
Name string
// Versions contains versions and a provider-specific identifier.
Versions []MachineImageVersion
}
// MachineImageVersion contains a version and a provider-specific identifier.
type MachineImageVersion struct {
// Version is the version of the image.
Version string
// Image is the name of the image.
Image string
// Regions is an optional mapping to the correct Image ID for the machine image in the supported regions.
Regions []RegionIDMapping
}
// RegionIDMapping is a mapping to the correct ID for the machine image in the given region.
type RegionIDMapping struct {
// Name is the name of the region.
Name string
// ID is the ID for the machine image in the given region.
ID string
}