@@ -15,48 +15,57 @@ import (
1515)
1616
1717const (
18- AssetPathSecrets = "tls"
19- AssetPathCAKey = "tls/ca.key"
20- AssetPathCACert = "tls/ca.crt"
21- AssetPathAPIServerKey = "tls/apiserver.key"
22- AssetPathAPIServerCert = "tls/apiserver.crt"
23- AssetPathEtcdCA = "tls/etcd-ca.crt"
24- AssetPathEtcdClientCert = "tls/etcd-client.crt"
25- AssetPathEtcdClientKey = "tls/etcd-client.key"
26- AssetPathEtcdPeerCert = "tls/etcd-peer.crt"
27- AssetPathEtcdPeerKey = "tls/etcd-peer.key"
28- AssetPathServiceAccountPrivKey = "tls/service-account.key"
29- AssetPathServiceAccountPubKey = "tls/service-account.pub"
30- AssetPathKubeletKey = "tls/kubelet.key"
31- AssetPathKubeletCert = "tls/kubelet.crt"
32- AssetPathKubeConfig = "auth/kubeconfig"
33- AssetPathManifests = "manifests"
34- AssetPathKubelet = "manifests/kubelet.yaml"
35- AssetPathProxy = "manifests/kube-proxy.yaml"
36- AssetPathKubeFlannel = "manifests/kube-flannel.yaml"
37- AssetPathKubeFlannelCfg = "manifests/kube-flannel-cfg.yaml"
38- AssetPathAPIServerSecret = "manifests/kube-apiserver-secret.yaml"
39- AssetPathAPIServer = "manifests/kube-apiserver.yaml"
40- AssetPathControllerManager = "manifests/kube-controller-manager.yaml"
41- AssetPathControllerManagerSecret = "manifests/kube-controller-manager-secret.yaml"
42- AssetPathControllerManagerDisruption = "manifests/kube-controller-manager-disruption.yaml"
43- AssetPathScheduler = "manifests/kube-scheduler.yaml"
44- AssetPathSchedulerDisruption = "manifests/kube-scheduler-disruption.yaml"
45- AssetPathKubeDNSDeployment = "manifests/kube-dns-deployment.yaml"
46- AssetPathKubeDNSSvc = "manifests/kube-dns-svc.yaml"
47- AssetPathSystemNamespace = "manifests/kube-system-ns.yaml"
48- AssetPathCheckpointer = "manifests/pod-checkpointer.yaml"
49- AssetPathEtcdOperator = "manifests/etcd-operator.yaml"
50- AssetPathEtcdSvc = "manifests/etcd-service.yaml"
51- AssetPathKenc = "manifests/kube-etcd-network-checkpointer.yaml"
52- AssetPathKubeSystemSARoleBinding = "manifests/kube-system-rbac-role-binding.yaml"
53- AssetPathBootstrapManifests = "bootstrap-manifests"
54- AssetPathBootstrapAPIServer = "bootstrap-manifests/bootstrap-apiserver.yaml"
55- AssetPathBootstrapControllerManager = "bootstrap-manifests/bootstrap-controller-manager.yaml"
56- AssetPathBootstrapScheduler = "bootstrap-manifests/bootstrap-scheduler.yaml"
57- AssetPathBootstrapEtcd = "bootstrap-manifests/bootstrap-etcd.yaml"
58- AssetPathBootstrapEtcdService = "etcd/bootstrap-etcd-service.json"
59- AssetPathMigrateEtcdCluster = "etcd/migrate-etcd-cluster.json"
18+ AssetPathSecrets = "tls"
19+ AssetPathCAKey = "tls/ca.key"
20+ AssetPathCACert = "tls/ca.crt"
21+ AssetPathAPIServerKey = "tls/apiserver.key"
22+ AssetPathAPIServerCert = "tls/apiserver.crt"
23+ AssetPathEtcdCA = "tls/etcd-ca.crt"
24+ AssetPathEtcdClientCert = "tls/etcd-client.crt"
25+ AssetPathEtcdClientKey = "tls/etcd-client.key"
26+ AssetPathEtcdPeerCert = "tls/etcd-peer.crt"
27+ AssetPathEtcdPeerKey = "tls/etcd-peer.key"
28+ AssetPathSelfHostedOperatorEtcdCA = "tls/operator/etcd-ca-crt.pem"
29+ AssetPathSelfHostedOperatorEtcdCert = "tls/operator/etcd-crt.pem"
30+ AssetPathSelfHostedOperatorEtcdKey = "tls/operator/etcd-key.pem"
31+ AssetPathSelfHostedEtcdMemberClientCA = "tls/etcdMember/client-ca-crt.pem"
32+ AssetPathSelfHostedEtcdMemberClientCert = "tls/etcdMember/client-crt.pem"
33+ AssetPathSelfHostedEtcdMemberClientKey = "tls/etcdMember/client-key.pem"
34+ AssetPathSelfHostedEtcdMemberPeerCA = "tls/etcdMember/peer-ca-crt.pem"
35+ AssetPathSelfHostedEtcdMemberPeerCert = "tls/etcdMember/peer-crt.pem"
36+ AssetPathSelfHostedEtcdMemberPeerKey = "tls/etcdMember/peer-key.pem"
37+ AssetPathServiceAccountPrivKey = "tls/service-account.key"
38+ AssetPathServiceAccountPubKey = "tls/service-account.pub"
39+ AssetPathKubeletKey = "tls/kubelet.key"
40+ AssetPathKubeletCert = "tls/kubelet.crt"
41+ AssetPathKubeConfig = "auth/kubeconfig"
42+ AssetPathManifests = "manifests"
43+ AssetPathKubelet = "manifests/kubelet.yaml"
44+ AssetPathProxy = "manifests/kube-proxy.yaml"
45+ AssetPathKubeFlannel = "manifests/kube-flannel.yaml"
46+ AssetPathKubeFlannelCfg = "manifests/kube-flannel-cfg.yaml"
47+ AssetPathAPIServerSecret = "manifests/kube-apiserver-secret.yaml"
48+ AssetPathAPIServer = "manifests/kube-apiserver.yaml"
49+ AssetPathControllerManager = "manifests/kube-controller-manager.yaml"
50+ AssetPathControllerManagerSecret = "manifests/kube-controller-manager-secret.yaml"
51+ AssetPathControllerManagerDisruption = "manifests/kube-controller-manager-disruption.yaml"
52+ AssetPathScheduler = "manifests/kube-scheduler.yaml"
53+ AssetPathSchedulerDisruption = "manifests/kube-scheduler-disruption.yaml"
54+ AssetPathKubeDNSDeployment = "manifests/kube-dns-deployment.yaml"
55+ AssetPathKubeDNSSvc = "manifests/kube-dns-svc.yaml"
56+ AssetPathSystemNamespace = "manifests/kube-system-ns.yaml"
57+ AssetPathCheckpointer = "manifests/pod-checkpointer.yaml"
58+ AssetPathEtcdOperator = "manifests/etcd-operator.yaml"
59+ AssetPathEtcdSvc = "manifests/etcd-service.yaml"
60+ AssetPathKenc = "manifests/kube-etcd-network-checkpointer.yaml"
61+ AssetPathKubeSystemSARoleBinding = "manifests/kube-system-rbac-role-binding.yaml"
62+ AssetPathBootstrapManifests = "bootstrap-manifests"
63+ AssetPathBootstrapAPIServer = "bootstrap-manifests/bootstrap-apiserver.yaml"
64+ AssetPathBootstrapControllerManager = "bootstrap-manifests/bootstrap-controller-manager.yaml"
65+ AssetPathBootstrapScheduler = "bootstrap-manifests/bootstrap-scheduler.yaml"
66+ AssetPathBootstrapEtcd = "bootstrap-manifests/bootstrap-etcd.yaml"
67+ AssetPathBootstrapEtcdService = "etcd/bootstrap-etcd-service.json"
68+ AssetPathMigrateEtcdCluster = "etcd/migrate-etcd-cluster.json"
6069)
6170
6271var (
@@ -133,11 +142,19 @@ func NewDefaultAssets(conf Config) (Assets, error) {
133142
134143 // etcd TLS assets.
135144 if conf .EtcdUseTLS {
136- etcdTLSAssets , err := newEtcdTLSAssets (conf .EtcdCACert , conf .EtcdClientCert , conf .EtcdClientKey , conf .CACert , conf .CAPrivKey , conf .EtcdServers )
137- if err != nil {
138- return Assets {}, err
145+ if conf .SelfHostedEtcd {
146+ tlsAssets , err := newSelfHostedEtcdTLSAssets (conf .EtcdServiceIP .String (), conf .BootEtcdServiceIP .String (), conf .CACert , conf .CAPrivKey )
147+ if err != nil {
148+ return nil , err
149+ }
150+ as = append (as , tlsAssets ... )
151+ } else {
152+ etcdTLSAssets , err := newEtcdTLSAssets (conf .EtcdCACert , conf .EtcdClientCert , conf .EtcdClientKey , conf .CACert , conf .CAPrivKey , conf .EtcdServers )
153+ if err != nil {
154+ return Assets {}, err
155+ }
156+ as = append (as , etcdTLSAssets ... )
139157 }
140- as = append (as , etcdTLSAssets ... )
141158 }
142159
143160 // K8S kubeconfig
0 commit comments