/
types.go
170 lines (148 loc) · 4.18 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
package v_6_0_0
import (
"github.com/giantswarm/apiextensions/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
// DisableCalico flag. When set removes all calico related Kubernetes
// manifests from the cloud config together with their initialization.
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
// Hyperkube allows to pass extra `docker run` and `command` arguments
// to hyperkube image commands. This allows to e.g. add cloud provider
// extensions.
Hyperkube Hyperkube
// EtcdPort allows the Etcd port 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.
EtcdPort int
Extension Extension
// 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
Node v1alpha1.ClusterNode
SSOPublicKey string
}
func (p *Params) Validate() error {
return nil
}
type Versions struct {
Calico string
CRITools string
Etcd string
Kubectl string
Kubernetes string
KubernetesAPIHealthz string
KubernetesNetworkSetupDocker string
}
type Debug struct {
Enabled bool
LogsPrefix string
LogsToken string
}
type Images struct {
CalicoCNI string
CalicoKubeControllers string
CalicoNode string
Etcd string
Hyperkube string
Kubectl string
KubernetesAPIHealthz string
KubernetesNetworkSetupDocker string
}
type Hyperkube struct {
Apiserver HyperkubeApiserver
ControllerManager HyperkubeControllerManager
Kubelet HyperkubeKubelet
}
type HyperkubeApiserver struct {
Pod HyperkubePod
}
type HyperkubeControllerManager struct {
Pod HyperkubePod
}
type HyperkubeKubelet struct {
Docker HyperkubeDocker
}
type HyperkubeDocker struct {
RunExtraArgs []string
CommandExtraArgs []string
}
type HyperkubePod struct {
HyperkubePodHostExtraMounts []HyperkubePodHostMount
CommandExtraArgs []string
}
type HyperkubePodHostMount struct {
Name string
Path string
ReadOnly bool
}
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
}