Skip to content

Commit

Permalink
Merge pull request #581 from sanchezl/move_manifest_etcd_client_secret
Browse files Browse the repository at this point in the history
add secret etcd-client.kube-system
  • Loading branch information
openshift-merge-robot authored Nov 2, 2018
2 parents 8be24fa + 50d4627 commit 20119ed
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package bootkube

import (
"text/template"
)

var (
// KubeSystemSecretEtcdClient is the constant to represent contents of kube-system-secret-etcd-client.yaml file
KubeSystemSecretEtcdClient = template.Must(template.New("kube-system-secret-etcd-client.yaml").Parse(`
apiVersion: v1
kind: Secret
metadata:
name: etcd-client
namespace: kube-system
type: SecretTypeTLS
data:
tls.crt: {{ .EtcdClientCert }}
tls.key: {{ .EtcdClientKey }}
`))
)
6 changes: 6 additions & 0 deletions pkg/asset/manifests/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (m *Manifests) Dependencies() []asset.Asset {
&tls.IngressCertKey{},
&tls.KubeCA{},
&tls.ServiceServingCA{},
&tls.EtcdClientCertKey{},
&tls.MCSCertKey{},
&tls.KubeletCertKey{},
}
Expand Down Expand Up @@ -91,10 +92,12 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
installConfig := &installconfig.InstallConfig{}
kubeCA := &tls.KubeCA{}
mcsCertKey := &tls.MCSCertKey{}
etcdClientCertKey := &tls.EtcdClientCertKey{}
rootCA := &tls.RootCA{}
serviceServingCA := &tls.ServiceServingCA{}
dependencies.Get(
installConfig,
etcdClientCertKey,
kubeCA,
mcsCertKey,
rootCA,
Expand All @@ -108,6 +111,8 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass

templateData := &bootkubeTemplateData{
Base64encodeCloudProviderConfig: "", // FIXME
EtcdClientCert: base64.StdEncoding.EncodeToString(etcdClientCertKey.Cert()),
EtcdClientKey: base64.StdEncoding.EncodeToString(etcdClientCertKey.Key()),
KubeCaCert: base64.StdEncoding.EncodeToString(kubeCA.Cert()),
KubeCaKey: base64.StdEncoding.EncodeToString(kubeCA.Key()),
McsTLSCert: base64.StdEncoding.EncodeToString(mcsCertKey.Cert()),
Expand All @@ -130,6 +135,7 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
"tectonic-network-operator.yaml": applyTemplateData(bootkube.TectonicNetworkOperator, templateData),
"cvo-overrides.yaml": applyTemplateData(bootkube.CVOOverrides, templateData),
"etcd-service-endpoints.yaml": applyTemplateData(bootkube.EtcdServiceEndpointsKubeSystem, templateData),
"kube-system-secret-etcd-client.yaml": applyTemplateData(bootkube.KubeSystemSecretEtcdClient, templateData),

"01-tectonic-namespace.yaml": []byte(bootkube.TectonicNamespace),
"03-openshift-web-console-namespace.yaml": []byte(bootkube.OpenshiftWebConsoleNamespace),
Expand Down
2 changes: 2 additions & 0 deletions pkg/asset/manifests/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type cloudCredsSecretData struct {

type bootkubeTemplateData struct {
Base64encodeCloudProviderConfig string
EtcdClientCert string
EtcdClientKey string
KubeCaCert string
KubeCaKey string
McsTLSCert string
Expand Down

0 comments on commit 20119ed

Please sign in to comment.