Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion data/data/bootstrap/files/usr/local/bin/bootkube.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ MACHINE_CONFIG_SETUP_ETCD_ENV_IMAGE=$(podman run --quiet --rm ${release} image s
MACHINE_CONFIG_KUBE_CLIENT_AGENT_IMAGE=$(podman run --quiet --rm ${release} image kube-client-agent)
MACHINE_CONFIG_INFRA_IMAGE=$(podman run --quiet --rm ${release} image pod)

KUBE_ETCD_SIGNER_SERVER_IMAGE=$(podman run --quiet --rm ${release} image kube-etcd-signer-server)

CONFIG_OPERATOR_IMAGE=$(podman run --quiet --rm ${release} image cluster-config-operator)
KUBE_APISERVER_OPERATOR_IMAGE=$(podman run --quiet --rm ${release} image cluster-kube-apiserver-operator)
KUBE_CONTROLLER_MANAGER_OPERATOR_IMAGE=$(podman run --quiet --rm ${release} image cluster-kube-controller-manager-operator)
Expand Down Expand Up @@ -222,7 +224,7 @@ podman run \
--detach \
--volume /opt/openshift/tls:/opt/openshift/tls:ro,z \
--network host \
"{{.EtcdCertSignerImage}}" \
"${KUBE_ETCD_SIGNER_SERVER_IMAGE}" \
serve \
--cacrt=/opt/openshift/tls/etcd-client-ca.crt \
--cakey=/opt/openshift/tls/etcd-client-ca.key \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: etcd-metrics-serving-ca
name: etcd-metric-serving-ca
namespace: openshift-config
data:
ca-bundle.crt: |
{{.EtcdMetricsCaCert | indent 4}}
{{.EtcdMetricCaCert | indent 4}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: etcd-metric-client
namespace: openshift-config
type: SecretTypeTLS
data:
tls.crt: {{ .EtcdMetricClientCert }}
tls.key: {{ .EtcdMetricClientKey }}

This file was deleted.

27 changes: 12 additions & 15 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ import (
const (
rootDir = "/opt/openshift"
bootstrapIgnFilename = "bootstrap.ign"
etcdCertSignerImage = "quay.io/coreos/kube-etcd-signer-server:678cc8e6841e2121ebfdb6e2db568fce290b67d6"
ignitionUser = "core"
)

// bootstrapTemplateData is the data to use to replace values in bootstrap
// template files.
type bootstrapTemplateData struct {
EtcdCertSignerImage string
EtcdCluster string
PullSecret string
ReleaseImage string
EtcdCluster string
PullSecret string
ReleaseImage string
}

// Bootstrap is an asset that generates the ignition config for bootstrap nodes.
Expand Down Expand Up @@ -71,9 +69,9 @@ func (a *Bootstrap) Dependencies() []asset.Asset {
&tls.EtcdCA{},
&tls.EtcdCABundle{},
&tls.EtcdClientCertKey{},
&tls.EtcdMetricsCABundle{},
&tls.EtcdMetricsSignerClientCertKey{},
&tls.EtcdMetricsSignerServerCertKey{},
&tls.EtcdMetricCABundle{},
&tls.EtcdMetricSignerCertKey{},
&tls.EtcdMetricSignerClientCertKey{},
&tls.EtcdSignerCertKey{},
&tls.EtcdSignerClientCertKey{},
&tls.JournalCertKey{},
Expand Down Expand Up @@ -184,10 +182,9 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig) (*bootst
}

return &bootstrapTemplateData{
EtcdCertSignerImage: etcdCertSignerImage,
PullSecret: installConfig.PullSecret,
ReleaseImage: releaseImage,
EtcdCluster: strings.Join(etcdEndpoints, ","),
PullSecret: installConfig.PullSecret,
ReleaseImage: releaseImage,
EtcdCluster: strings.Join(etcdEndpoints, ","),
}, nil
}

Expand Down Expand Up @@ -390,9 +387,9 @@ func (a *Bootstrap) addParentFiles(dependencies asset.Parents) {
&tls.EtcdCA{},
&tls.EtcdCABundle{},
&tls.EtcdClientCertKey{},
&tls.EtcdMetricsCABundle{},
&tls.EtcdMetricsSignerClientCertKey{},
&tls.EtcdMetricsSignerServerCertKey{},
&tls.EtcdMetricCABundle{},
&tls.EtcdMetricSignerCertKey{},
&tls.EtcdMetricSignerClientCertKey{},
&tls.EtcdSignerCertKey{},
&tls.EtcdSignerClientCertKey{},
&tls.KubeAPIServerLBCABundle{},
Expand Down
26 changes: 13 additions & 13 deletions pkg/asset/manifests/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func (m *Manifests) Dependencies() []asset.Asset {
&tls.EtcdCABundle{},
&tls.EtcdSignerClientCertKey{},
&tls.EtcdClientCertKey{},
&tls.EtcdMetricsCABundle{},
&tls.EtcdMetricsSignerClientCertKey{},
&tls.EtcdMetricCABundle{},
&tls.EtcdMetricSignerClientCertKey{},
&tls.MCSCertKey{},

&bootkube.CVOOverrides{},
Expand All @@ -82,8 +82,8 @@ func (m *Manifests) Dependencies() []asset.Asset {
&bootkube.KubeSystemSecretEtcdSigner{},
&bootkube.KubeSystemSecretEtcdSignerClient{},
&bootkube.MachineConfigServerTLSSecret{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricsServingCA{},
&bootkube.OpenshiftConfigSecretEtcdMetricsClient{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricServingCA{},
&bootkube.OpenshiftConfigSecretEtcdMetricClient{},
&bootkube.OpenshiftMachineConfigOperator{},
&bootkube.Pull{},
}
Expand Down Expand Up @@ -140,8 +140,8 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
etcdCA := &tls.EtcdCA{}
mcsCertKey := &tls.MCSCertKey{}
etcdClientCertKey := &tls.EtcdClientCertKey{}
etcdMetricsCABundle := &tls.EtcdMetricsCABundle{}
etcdMetricsSignerClientCertKey := &tls.EtcdMetricsSignerClientCertKey{}
etcdMetricCABundle := &tls.EtcdMetricCABundle{}
etcdMetricSignerClientCertKey := &tls.EtcdMetricSignerClientCertKey{}
rootCA := &tls.RootCA{}
etcdSignerCertKey := &tls.EtcdSignerCertKey{}
etcdCABundle := &tls.EtcdCABundle{}
Expand All @@ -154,8 +154,8 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
etcdCABundle,
etcdSignerClientCertKey,
etcdClientCertKey,
etcdMetricsCABundle,
etcdMetricsSignerClientCertKey,
etcdMetricCABundle,
etcdMetricSignerClientCertKey,
mcsCertKey,
rootCA,
)
Expand All @@ -176,9 +176,9 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
EtcdClientKey: base64.StdEncoding.EncodeToString(etcdClientCertKey.Key()),
EtcdEndpointDNSSuffix: installConfig.Config.ClusterDomain(),
EtcdEndpointHostnames: etcdEndpointHostnames,
EtcdMetricsCaCert: string(etcdMetricsCABundle.Cert()),
EtcdMetricsClientCert: base64.StdEncoding.EncodeToString(etcdMetricsSignerClientCertKey.Cert()),
EtcdMetricsClientKey: base64.StdEncoding.EncodeToString(etcdMetricsSignerClientCertKey.Key()),
EtcdMetricCaCert: string(etcdMetricCABundle.Cert()),
EtcdMetricClientCert: base64.StdEncoding.EncodeToString(etcdMetricSignerClientCertKey.Cert()),
EtcdMetricClientKey: base64.StdEncoding.EncodeToString(etcdMetricSignerClientCertKey.Key()),
EtcdSignerCert: base64.StdEncoding.EncodeToString(etcdSignerCertKey.Cert()),
EtcdSignerClientCert: base64.StdEncoding.EncodeToString(etcdSignerClientCertKey.Cert()),
EtcdSignerClientKey: base64.StdEncoding.EncodeToString(etcdSignerClientCertKey.Key()),
Expand All @@ -204,8 +204,8 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
&bootkube.KubeSystemSecretEtcdSigner{},
&bootkube.KubeSystemSecretEtcdSignerClient{},
&bootkube.MachineConfigServerTLSSecret{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricsServingCA{},
&bootkube.OpenshiftConfigSecretEtcdMetricsClient{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricServingCA{},
&bootkube.OpenshiftConfigSecretEtcdMetricClient{},
&bootkube.OpenshiftMachineConfigOperator{},
&bootkube.Pull{},
} {
Expand Down
6 changes: 3 additions & 3 deletions pkg/asset/manifests/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ type bootkubeTemplateData struct {
EtcdClientKey string
EtcdEndpointDNSSuffix string
EtcdEndpointHostnames []string
EtcdMetricsCaCert string
EtcdMetricsClientCert string
EtcdMetricsClientKey string
EtcdMetricCaCert string
EtcdMetricClientCert string
EtcdMetricClientKey string
EtcdSignerCert string
EtcdSignerClientCert string
EtcdSignerClientKey string
Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/targets/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ var (
&bootkube.OpenshiftMachineConfigOperator{},
&bootkube.EtcdServiceKubeSystem{},
&bootkube.HostEtcdServiceKubeSystem{},
&bootkube.OpenshiftConfigSecretEtcdMetricsClient{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricsServingCA{},
&bootkube.OpenshiftConfigSecretEtcdMetricClient{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricServingCA{},
&openshift.BindingDiscovery{},
&openshift.CloudCredsSecret{},
&openshift.KubeadminPasswordSecret{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import (
)

const (
openshiftConfigConfigmapEtcdMetricsServingCAFileName = "openshift-config-configmap-etcd-metrics-serving-ca.yaml.template"
openshiftConfigConfigmapEtcdMetricServingCAFileName = "openshift-config-configmap-etcd-metric-serving-ca.yaml.template"
)

var _ asset.WritableAsset = (*OpenshiftConfigConfigmapEtcdMetricsServingCA)(nil)
var _ asset.WritableAsset = (*OpenshiftConfigConfigmapEtcdMetricServingCA)(nil)

// OpenshiftConfigConfigmapEtcdMetricsServingCA is the constant to represent contents of openshift-config-configmap-etcd-metrics-serving-ca.yaml.template file.
type OpenshiftConfigConfigmapEtcdMetricsServingCA struct {
// OpenshiftConfigConfigmapEtcdMetricServingCA is the constant to represent contents of openshift-config-configmap-etcd-metric-serving-ca.yaml.template file.
type OpenshiftConfigConfigmapEtcdMetricServingCA struct {
FileList []*asset.File
}

// Dependencies returns all of the dependencies directly needed by the asset
func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Dependencies() []asset.Asset {
func (t *OpenshiftConfigConfigmapEtcdMetricServingCA) Dependencies() []asset.Asset {
return []asset.Asset{}
}

// Name returns the human-friendly name of the asset.
func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Name() string {
return "OpenshiftConfigConfigmapEtcdMetricsServingCA"
func (t *OpenshiftConfigConfigmapEtcdMetricServingCA) Name() string {
return "OpenshiftConfigConfigmapEtcdMetricServingCA"
}

// Generate generates the actual files by this asset
func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Generate(parents asset.Parents) error {
fileName := openshiftConfigConfigmapEtcdMetricsServingCAFileName
func (t *OpenshiftConfigConfigmapEtcdMetricServingCA) Generate(parents asset.Parents) error {
fileName := openshiftConfigConfigmapEtcdMetricServingCAFileName
data, err := content.GetBootkubeTemplate(fileName)
if err != nil {
return err
Expand All @@ -46,13 +46,13 @@ func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Generate(parents asset.Pa
}

// Files returns the files generated by the asset.
func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Files() []*asset.File {
func (t *OpenshiftConfigConfigmapEtcdMetricServingCA) Files() []*asset.File {
return t.FileList
}

// Load returns the asset from disk.
func (t *OpenshiftConfigConfigmapEtcdMetricsServingCA) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, openshiftConfigConfigmapEtcdMetricsServingCAFileName))
func (t *OpenshiftConfigConfigmapEtcdMetricServingCA) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, openshiftConfigConfigmapEtcdMetricServingCAFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import (
)

const (
openshiftConfigSecretEtcdMetricsClientFileName = "openshift-config-secret-etcd-metrics-client.yaml.template"
openshiftConfigSecretEtcdMetricClientFileName = "openshift-config-secret-etcd-metric-client.yaml.template"
)

var _ asset.WritableAsset = (*OpenshiftConfigSecretEtcdMetricsClient)(nil)
var _ asset.WritableAsset = (*OpenshiftConfigSecretEtcdMetricClient)(nil)

// OpenshiftConfigSecretEtcdMetricsClient is the constant to represent contents of openshift-config-secret-etcd-metrics-client.yaml.template file.
type OpenshiftConfigSecretEtcdMetricsClient struct {
// OpenshiftConfigSecretEtcdMetricClient is the constant to represent contents of openshift-config-secret-etcd-metric-client.yaml.template file.
type OpenshiftConfigSecretEtcdMetricClient struct {
FileList []*asset.File
}

// Dependencies returns all of the dependencies directly needed by the asset
func (t *OpenshiftConfigSecretEtcdMetricsClient) Dependencies() []asset.Asset {
func (t *OpenshiftConfigSecretEtcdMetricClient) Dependencies() []asset.Asset {
return []asset.Asset{}
}

// Name returns the human-friendly name of the asset.
func (t *OpenshiftConfigSecretEtcdMetricsClient) Name() string {
return "OpenshiftConfigSecretEtcdMetricsClient"
func (t *OpenshiftConfigSecretEtcdMetricClient) Name() string {
return "OpenshiftConfigSecretEtcdMetricClient"
}

// Generate generates the actual files by this asset
func (t *OpenshiftConfigSecretEtcdMetricsClient) Generate(parents asset.Parents) error {
fileName := openshiftConfigSecretEtcdMetricsClientFileName
func (t *OpenshiftConfigSecretEtcdMetricClient) Generate(parents asset.Parents) error {
fileName := openshiftConfigSecretEtcdMetricClientFileName
data, err := content.GetBootkubeTemplate(fileName)
if err != nil {
return err
Expand All @@ -46,13 +46,13 @@ func (t *OpenshiftConfigSecretEtcdMetricsClient) Generate(parents asset.Parents)
}

// Files returns the files generated by the asset.
func (t *OpenshiftConfigSecretEtcdMetricsClient) Files() []*asset.File {
func (t *OpenshiftConfigSecretEtcdMetricClient) Files() []*asset.File {
return t.FileList
}

// Load returns the asset from disk.
func (t *OpenshiftConfigSecretEtcdMetricsClient) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, openshiftConfigSecretEtcdMetricsClientFileName))
func (t *OpenshiftConfigSecretEtcdMetricClient) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, openshiftConfigSecretEtcdMetricClientFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
Expand Down
Loading