Remove references to ClusterSpec.EtcdClusters from nodeup

This commit is contained in:
John Gardiner Myers 2023-07-11 12:01:09 -07:00
parent 56a8f46952
commit 9368470fc4
3 changed files with 17 additions and 11 deletions

View File

@ -36,19 +36,17 @@ func (b *EtcdManagerTLSBuilder) Build(ctx *fi.NodeupModelBuilderContext) error {
return nil return nil
} }
for _, etcdCluster := range b.Cluster.Spec.EtcdClusters { for _, etcdClusterName := range b.NodeupConfig.EtcdClusterNames {
k := etcdCluster.Name d := "/etc/kubernetes/pki/etcd-manager-" + etcdClusterName
d := "/etc/kubernetes/pki/etcd-manager-" + k
keys := make(map[string]string) keys := make(map[string]string)
keys["etcd-manager-ca"] = "etcd-manager-ca-" + k keys["etcd-manager-ca"] = "etcd-manager-ca-" + etcdClusterName
keys["etcd-peers-ca"] = "etcd-peers-ca-" + k keys["etcd-peers-ca"] = "etcd-peers-ca-" + etcdClusterName
keys["etcd-clients-ca"] = "etcd-clients-ca-" + k keys["etcd-clients-ca"] = "etcd-clients-ca-" + etcdClusterName
// Because API server can only have a single client certificate for etcd, we need to share a client CA // Because API server can only have a single client certificate for etcd, we need to share a client CA
if k == "main" || k == "events" { if etcdClusterName == "main" || etcdClusterName == "events" {
keys["etcd-clients-ca"] = "etcd-clients-ca" keys["etcd-clients-ca"] = "etcd-clients-ca"
} }

View File

@ -44,7 +44,9 @@ type Config struct {
// Packages specifies additional packages to be installed. // Packages specifies additional packages to be installed.
Packages []string `json:"packages,omitempty"` Packages []string `json:"packages,omitempty"`
// Manifests for running etcd // EtcdClusterNames are the names of the etcd clusters.
EtcdClusterNames []string `json:",omitempty"`
// EtcdManifests are the manifests for running etcd.
EtcdManifests []string `json:"etcdManifests,omitempty"` EtcdManifests []string `json:"etcdManifests,omitempty"`
// CAs are the CA certificates to trust. // CAs are the CA certificates to trust.

View File

@ -1411,6 +1411,7 @@ func (n *nodeUpConfigBuilder) BuildConfig(ig *kops.InstanceGroup, apiserverAddit
} }
if isMaster || usesLegacyGossip { if isMaster || usesLegacyGossip {
config.Channels = n.channels
for _, arch := range architectures.GetSupported() { for _, arch := range architectures.GetSupported() {
for _, a := range n.protokubeAsset[arch] { for _, a := range n.protokubeAsset[arch] {
config.Assets[arch] = append(config.Assets[arch], a.CompactString()) config.Assets[arch] = append(config.Assets[arch], a.CompactString())
@ -1542,8 +1543,13 @@ func (n *nodeUpConfigBuilder) BuildConfig(ig *kops.InstanceGroup, apiserverAddit
} }
config.Images = n.images[role] config.Images = n.images[role]
config.Channels = n.channels
config.EtcdManifests = n.etcdManifests[ig.Name] if isMaster {
for _, etcdCluster := range cluster.Spec.EtcdClusters {
config.EtcdClusterNames = append(config.EtcdClusterNames, etcdCluster.Name)
}
config.EtcdManifests = n.etcdManifests[ig.Name]
}
if cluster.Spec.CloudProvider.AWS != nil { if cluster.Spec.CloudProvider.AWS != nil {
if ig.Spec.WarmPool != nil || cluster.Spec.CloudProvider.AWS.WarmPool != nil { if ig.Spec.WarmPool != nil || cluster.Spec.CloudProvider.AWS.WarmPool != nil {