@@ -20,6 +20,7 @@ import (
20
20
"fmt"
21
21
"io/ioutil"
22
22
"path/filepath"
23
+ "strings"
23
24
24
25
"k8s.io/api/core/v1"
25
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -128,6 +129,40 @@ func apiServerCertificatesVolumeSource() v1.VolumeSource {
128
129
},
129
130
},
130
131
},
132
+ {
133
+ Secret : & v1.SecretProjection {
134
+ LocalObjectReference : v1.LocalObjectReference {
135
+ Name : strings .Replace (kubeadmconstants .EtcdCACertAndKeyBaseName , "/" , "-" , - 1 ),
136
+ },
137
+ Items : []v1.KeyToPath {
138
+ {
139
+ Key : v1 .TLSCertKey ,
140
+ Path : kubeadmconstants .EtcdCACertName ,
141
+ },
142
+ {
143
+ Key : v1 .TLSPrivateKeyKey ,
144
+ Path : kubeadmconstants .EtcdCAKeyName ,
145
+ },
146
+ },
147
+ },
148
+ },
149
+ {
150
+ Secret : & v1.SecretProjection {
151
+ LocalObjectReference : v1.LocalObjectReference {
152
+ Name : kubeadmconstants .APIServerEtcdClientCertAndKeyBaseName ,
153
+ },
154
+ Items : []v1.KeyToPath {
155
+ {
156
+ Key : v1 .TLSCertKey ,
157
+ Path : kubeadmconstants .APIServerEtcdClientCertName ,
158
+ },
159
+ {
160
+ Key : v1 .TLSPrivateKeyKey ,
161
+ Path : kubeadmconstants .APIServerEtcdClientKeyName ,
162
+ },
163
+ },
164
+ },
165
+ },
131
166
},
132
167
},
133
168
}
@@ -175,7 +210,7 @@ func controllerManagerCertificatesVolumeSource() v1.VolumeSource {
175
210
func kubeConfigVolumeSource (kubeconfigSecretName string ) v1.VolumeSource {
176
211
return v1.VolumeSource {
177
212
Secret : & v1.SecretVolumeSource {
178
- SecretName : kubeconfigSecretName ,
213
+ SecretName : strings . Replace ( kubeconfigSecretName , "/" , "-" , - 1 ) ,
179
214
},
180
215
}
181
216
}
@@ -294,5 +329,15 @@ func getTLSKeyPairs() []*tlsKeyPair {
294
329
cert : kubeadmconstants .FrontProxyClientCertName ,
295
330
key : kubeadmconstants .FrontProxyClientKeyName ,
296
331
},
332
+ {
333
+ name : strings .Replace (kubeadmconstants .EtcdCACertAndKeyBaseName , "/" , "-" , - 1 ),
334
+ cert : kubeadmconstants .EtcdCACertName ,
335
+ key : kubeadmconstants .EtcdCAKeyName ,
336
+ },
337
+ {
338
+ name : kubeadmconstants .APIServerEtcdClientCertAndKeyBaseName ,
339
+ cert : kubeadmconstants .APIServerEtcdClientCertName ,
340
+ key : kubeadmconstants .APIServerEtcdClientKeyName ,
341
+ },
297
342
}
298
343
}
0 commit comments