-
Notifications
You must be signed in to change notification settings - Fork 10
/
types.go
217 lines (197 loc) · 7.11 KB
/
types.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package template
import (
"github.com/giantswarm/apiextensions/v6/pkg/apis/provider/v1alpha1"
)
type Params struct {
// APIServerEncryptionKey is AES-CBC with PKCS#7 padding key to encrypt API
// etcd data.
APIServerEncryptionKey string
BaseDomain string
Cluster v1alpha1.Cluster
// Debug options
Debug Debug
// EnableAWSCNI flag. When set to true will use AWS CNI for pod networking
// and Calico only for network policies.
EnableAWSCNI bool
// EnableCSIMigrationAWS flag. When set to true will use in-tree EBS volumes will be migrated to CSI.
EnableCSIMigrationAWS bool
// force cgroups v1 on flatcar 3033.2.1 and above
// this configuration will do reboot to ensure kernel loaded the arguments
ForceCGroupsV1 bool
// InTreePluginAWSUnregister flag. Disables the AWS EBS in-tree driver
InTreePluginAWSUnregister bool
// CalicoPolicyOnly flag. When set to true will deploy calico for network policies only.
CalicoPolicyOnly bool
// DisableCalico allow preventing calico installation.
DisableCalico bool
// DisableEncryptionAtREST flag. When set removes all manifests from the cloud
// config related to Kubernetes encryption at REST.
DisableEncryptionAtREST bool
// DisableIngressControllerService flag. When set removes the manifest for
// the Ingress Controller service. This allows us to migrate providers to
// chart-operator independently.
DisableIngressControllerService bool
// DockerhubToken is an auth token used by kubelet to
// authenticate/authorize against https://index.docker.io/v1/.
// DisableKubeProxy allows to avoid installing kube-proxy in a cluster.
DisableKubeProxy bool
DockerhubToken string
Etcd Etcd
Extension Extension
// ExternalCloudControllerManager when set to true, it disables in-tree cloud controller manager
// by setting `--cloud-provider` flag to `external` for api-server, kubelet and controller-manager.
// When set to `true` it needs an external controller manager to be run as a pod in the cluster.
ExternalCloudControllerManager bool
// ExtraManifests allows to specify extra Kubernetes manifests in
// /opt/k8s-addons script. The manifests are applied after calico is
// ready.
//
// The general use-case is to create a manifest file with Extension and
// then apply the manifest by adding it to ExtraManifests.
ExtraManifests []string
Files Files
// ImagePullProgressDeadline is the duration after which image pulling is
// cancelled if no progress has been made.
ImagePullProgressDeadline string
// Container images used in the cloud-config templates
Images Images
// Kubernetes components allow the passing of extra `docker run` and
// `command` arguments to image commands. This allows, for example,
// the addition of cloud provider extensions.
Kubernetes Kubernetes
KVMWorkerMountTags []string
Node v1alpha1.ClusterNode
// Proxy environment to be configured for systemd units (docker).
Proxy Proxy
// RegistryMirrors to be configured for docker daemon. It should be
// domain names only without the protocol prefix, e.g.:
// ["giantswarm.azurecr.io"].
RegistryMirrors []string
SSOPublicKey string
Versions Versions
}
type Proxy struct {
HTTP string
HTTPS string
NoProxy string
}
type Versions struct {
Calico string
CRITools string
Etcd string
Kubernetes string
KubernetesAPIHealthz string
KubernetesNetworkSetupDocker string
}
type Debug struct {
Enabled bool
LogsPrefix string
LogsToken string
}
type Images struct {
CalicoCNI string
CalicoCRDInstaller string
Calicoctl string
CalicoKubeControllers string
CalicoNode string
CalicoTypha string
Envsubst string
Etcd string
Hyperkube string
KubeApiserver string
KubeControllerManager string
KubeScheduler string
KubeProxy string
KubernetesAPIHealthz string
KubernetesNetworkSetupDocker string
Pause string
}
type Kubernetes struct {
Apiserver KubernetesPodOptions
ControllerManager KubernetesPodOptions
Kubelet KubernetesDockerOptions
}
type KubernetesDockerOptions struct {
RunExtraArgs []string
CommandExtraArgs []string
}
type KubernetesPodOptions struct {
HostExtraMounts []KubernetesPodOptionsHostMount
CommandExtraArgs []string
// ServiceAccountKeyFilePath is the path to the file to be used as `--service-account-key-file` in api server flags.
// If left empty the default value '/etc/kubernetes/ssl/service-account-key.pem' is used
ServiceAccountKeyFilePath string
// ServiceAccountSigningKeyFilePath is the path to the file that contains the current private key of the service account token issuer. The issuer will sign issued ID tokens with this private key.
// If left empty the default value '/etc/kubernetes/ssl/service-account-key.pem' is used
ServiceAccountSigningKeyFilePath string
}
type KubernetesPodOptionsHostMount struct {
Name string
Path string
ReadOnly bool
}
type Etcd struct {
// ClientPort allows the port for clients to be specified.
// aws-operator sets this to the Etcd listening port so Calico on the
// worker nodes can access via a CNAME record to the master.
ClientPort int
// Enabled when set to true will cause rendering master template for cluster of 3 masters. Single master otherwise.
// Defaults to false.
HighAvailability bool
// InitialCluster is config which define which etcd are members of the cluster.
// The format should look like this: `etcd1=https://etcd1.example.com:2380,etcd2=https://etcd2.example.com:2380,etcd3=https://etcd3.example.com:2380`
// Where etcd1.example.com, etcd2.example.com, and etcd3.example.com can be either the IP or DNS of the master machine
// where is etcd listening.
InitialCluster string
// Initial cluster state for the etcd cluster. Should have values either `new` or `existing`.
InitialClusterState string
// NodeName is the name of the current etcd cluster node.
NodeName string
}
type FileMetadata struct {
AssetContent string
Path string
Owner Owner
Compression bool
Permissions int
}
type Owner struct {
Group Group
User User
}
// Group object reflects spec for ignition Group object.
// If both ID and name are specified, ID is preferred.
type Group struct {
ID int
Name string
}
// User object reflects spec for ignition User object.
// If both ID and name are specified, ID is preferred.
type User struct {
ID int
Name string
}
type FileAsset struct {
Metadata FileMetadata
Content string
}
type UnitMetadata struct {
AssetContent string
Name string
Enabled bool
}
type UnitAsset struct {
Metadata UnitMetadata
Content []string
}
// VerbatimSection is a blob of YAML we want to add to the
// CloudConfig, with no variable interpolation.
type VerbatimSection struct {
Name string
Content string
}
type Extension interface {
Files() ([]FileAsset, error)
Units() ([]UnitAsset, error)
VerbatimSections() []VerbatimSection
}