You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// findMatchingBindAddress attempts to find the bind address for dqlite from the 'host:port' of the join request.
@@ -70,7 +70,7 @@ nextAddr:
70
70
71
71
// kubeAPIServerPrefersInternalIPForKubelet checks whether the --kubelet-preferred-address-types of kube-apiserver includes 'InternalIP' with higher preference over 'Hostname'
// ClusterCIDR is the cidr that is used by the cluster, defined in kube-proxy args.
81
84
ClusterCIDRstring`json:"cluster_cidr,omitempty"`
85
+
// EtcdServers is the value of the kube-apiserver '--etcd-servers' argument, containing the list of etcd endpoints to use.
86
+
// This is only included in the response when a custom data store is configured.
87
+
EtcdServersstring`json:"etcd_servers,omitempty"`
88
+
// EtcdCertificateAuthority is the contents of the file from the kube-apiserver '--etcd-cafile' argument, containing a CA for connecting to the etcd servers. Will be empty if not using TLS.
89
+
// This is only included in the response when a custom data store is configured.
// EtcdClientCertificate is the contents of the file from the kube-apiserver '--etcd-certfile' argument, containing a certificate for connecting to the etcd servers. Will be empty if not using TLS.
92
+
// This is only included in the response when a custom data store is configured.
// EtcdClientKey is the contents of the file from the kube-apiserver '--etcd-keyfile' argument, containing a private key for connecting to the etcd servers. Will be empty if not using TLS.
95
+
// This is only included in the response when a custom data store is configured.
96
+
EtcdClientKeystring`json:"etcd_key,omitempty"`
82
97
}
83
98
84
99
// Join implements "POST v2/join".
@@ -92,7 +107,7 @@ func (a *API) Join(ctx context.Context, req JoinRequest) (*JoinResponse, int, er
returnnil, http.StatusBadGateway, fmt.Errorf("the port of the cluster agent port has to be set to %s", port)
@@ -110,45 +125,57 @@ func (a *API) Join(ctx context.Context, req JoinRequest) (*JoinResponse, int, er
110
125
returnnil, http.StatusBadRequest, fmt.Errorf("the hostname (%s) of the joining node does not resolve to the IP %q. Refusing join", req.RemoteHostName, remoteIP)
returnnil, http.StatusInternalServerError, fmt.Errorf("failed waiting for dqlite cluster to come up: %w", err)
168
+
}
169
+
}
170
+
a.dqliteMu.Unlock()
171
+
172
+
casereq.CanHandleCustomEtcd:
173
+
// no-op
174
+
175
+
default:
176
+
// fail since this node is using a custom datastore and the client cannot handle it properly.
177
+
returnnil, http.StatusInternalServerError, fmt.Errorf("this MicroK8s cluster uses a custom etcd endpoint. update MicroK8s to version 1.28 or newer and retry the join operation")
returnnil, http.StatusInternalServerError, fmt.Errorf("failed to retrieve token for admin user: %w", err)
215
242
}
216
243
case!req.CanHandleCertificateAuth:
217
244
returnnil, http.StatusInternalServerError, fmt.Errorf("joining this MicroK8s cluster requires x509 authentication. update MicroK8s to version 1.28 or newer and retry the join operation")
returnnil, http.StatusInternalServerError, fmt.Errorf("failed to read etcd certificates: %w", err)
231
276
}
277
+
default:
278
+
// fail since this node is using a custom datastore and the client cannot handle it properly.
279
+
returnnil, http.StatusInternalServerError, fmt.Errorf("this MicroK8s cluster uses a custom etcd endpoint. update MicroK8s to version 1.28 or newer and retry the join operation")
0 commit comments