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
6 changes: 6 additions & 0 deletions data/data/manifests/bootkube/etcd-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-etcd
labels:
openshift.io/run-level: "1"
2 changes: 1 addition & 1 deletion data/data/manifests/bootkube/etcd-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: etcd
namespace: kube-system
namespace: openshift-etcd
labels:
# this label is used to indicate that it should be scraped by prometheus
k8s-app: etcd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Endpoints
metadata:
name: host-etcd
namespace: kube-system
namespace: openshift-etcd
annotations:
alpha.installer.openshift.io/dns-suffix: {{.EtcdEndpointDNSSuffix}}
subsets:
Expand Down
2 changes: 1 addition & 1 deletion data/data/manifests/bootkube/host-etcd-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: host-etcd
namespace: kube-system
namespace: openshift-etcd
labels:
# this label is used to indicate that it should be scraped by prometheus
k8s-app: etcd
Expand Down
1,114 changes: 563 additions & 551 deletions docs/design/resource_dep.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions pkg/asset/manifests/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ func (m *Manifests) Dependencies() []asset.Asset {
&tls.MCSCertKey{},

&bootkube.CVOOverrides{},
&bootkube.EtcdServiceKubeSystem{},
&bootkube.HostEtcdServiceEndpointsKubeSystem{},
&bootkube.HostEtcdServiceKubeSystem{},
&bootkube.EtcdNamespaceOpenshiftEtcd{},
&bootkube.EtcdServiceOpenshiftEtcd{},
&bootkube.HostEtcdServiceEndpointsOpenshiftEtcd{},
&bootkube.HostEtcdServiceOpenshiftEtcd{},
&bootkube.KubeCloudConfig{},
&bootkube.KubeSystemConfigmapEtcdCA{},
&bootkube.KubeSystemConfigmapEtcdServingCA{},
Expand Down Expand Up @@ -191,9 +192,10 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
files := []*asset.File{}
for _, a := range []asset.WritableAsset{
&bootkube.CVOOverrides{},
&bootkube.EtcdServiceKubeSystem{},
&bootkube.HostEtcdServiceEndpointsKubeSystem{},
&bootkube.HostEtcdServiceKubeSystem{},
&bootkube.EtcdNamespaceOpenshiftEtcd{},
&bootkube.EtcdServiceOpenshiftEtcd{},
&bootkube.HostEtcdServiceEndpointsOpenshiftEtcd{},
&bootkube.HostEtcdServiceOpenshiftEtcd{},
&bootkube.KubeCloudConfig{},
&bootkube.KubeSystemConfigmapEtcdCA{},
&bootkube.KubeSystemConfigmapEtcdServingCA{},
Expand Down
7 changes: 4 additions & 3 deletions pkg/asset/targets/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ var (
&bootkube.KubeCloudConfig{},
&bootkube.MachineConfigServerTLSSecret{},
&bootkube.CVOOverrides{},
&bootkube.HostEtcdServiceEndpointsKubeSystem{},
&bootkube.HostEtcdServiceEndpointsOpenshiftEtcd{},
&bootkube.KubeSystemConfigmapEtcdServingCA{},
&bootkube.KubeSystemConfigmapRootCA{},
&bootkube.KubeSystemSecretEtcdClient{},
&bootkube.OpenshiftMachineConfigOperator{},
&bootkube.EtcdServiceKubeSystem{},
&bootkube.HostEtcdServiceKubeSystem{},
&bootkube.EtcdNamespaceOpenshiftEtcd{},
&bootkube.EtcdServiceOpenshiftEtcd{},
&bootkube.HostEtcdServiceOpenshiftEtcd{},
&bootkube.OpenshiftConfigSecretEtcdMetricClient{},
&bootkube.OpenshiftConfigConfigmapEtcdMetricServingCA{},
&bootkube.OpenshiftConfigSecretPullSecret{},
Expand Down
64 changes: 64 additions & 0 deletions pkg/asset/templates/content/bootkube/etcd-namespace.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package bootkube

import (
"os"
"path/filepath"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/templates/content"
)

const (
etcdNamespaceOpenshiftEtcdFileName = "etcd-namespace.yaml"
)

var _ asset.WritableAsset = (*EtcdNamespaceOpenshiftEtcd)(nil)

// EtcdNamespaceOpenshiftEtcd is the constant to represent contents of etcd-service.yaml file
type EtcdNamespaceOpenshiftEtcd struct {
FileList []*asset.File
}

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

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

// Generate generates the actual files by this asset
func (t *EtcdNamespaceOpenshiftEtcd) Generate(parents asset.Parents) error {
fileName := etcdNamespaceOpenshiftEtcdFileName
data, err := content.GetBootkubeTemplate(fileName)
if err != nil {
return err
}
t.FileList = []*asset.File{
{
Filename: filepath.Join(content.TemplateDir, fileName),
Data: []byte(data),
},
}
return nil
}

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

// Load returns the asset from disk.
func (t *EtcdNamespaceOpenshiftEtcd) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, etcdNamespaceOpenshiftEtcdFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
t.FileList = []*asset.File{file}
return true, nil
}
24 changes: 12 additions & 12 deletions pkg/asset/templates/content/bootkube/etcd-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import (
)

const (
etcdServiceKubeSystemFileName = "etcd-service.yaml"
etcdServiceOpenshiftEtcdFileName = "etcd-service.yaml"
)

var _ asset.WritableAsset = (*EtcdServiceKubeSystem)(nil)
var _ asset.WritableAsset = (*EtcdServiceOpenshiftEtcd)(nil)

// EtcdServiceKubeSystem is the constant to represent contents of etcd-service.yaml file
type EtcdServiceKubeSystem struct {
// EtcdServiceOpenshiftEtcd is the constant to represent contents of etcd-service.yaml file
type EtcdServiceOpenshiftEtcd struct {
FileList []*asset.File
}

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

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

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

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

// Load returns the asset from disk.
func (t *EtcdServiceKubeSystem) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, etcdServiceKubeSystemFileName))
func (t *EtcdServiceOpenshiftEtcd) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, etcdServiceOpenshiftEtcdFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
Expand Down
24 changes: 12 additions & 12 deletions pkg/asset/templates/content/bootkube/host-etcd-service-endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import (
)

const (
hostEtcdServiceEndpointsKubeSystemFileName = "host-etcd-service-endpoints.yaml.template"
hostEtcdServiceEndpointsOpenshiftEtcdFileName = "host-etcd-service-endpoints.yaml.template"
)

var _ asset.WritableAsset = (*HostEtcdServiceEndpointsKubeSystem)(nil)
var _ asset.WritableAsset = (*HostEtcdServiceEndpointsOpenshiftEtcd)(nil)

// HostEtcdServiceEndpointsKubeSystem is the constant to represent contents of etcd-service-endpoints.yaml.template file.
type HostEtcdServiceEndpointsKubeSystem struct {
// HostEtcdServiceEndpointsOpenshiftEtcd is the constant to represent contents of etcd-service-endpoints.yaml.template file.
type HostEtcdServiceEndpointsOpenshiftEtcd struct {
FileList []*asset.File
}

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

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

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

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

// Load returns the asset from disk.
func (t *HostEtcdServiceEndpointsKubeSystem) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, hostEtcdServiceEndpointsKubeSystemFileName))
func (t *HostEtcdServiceEndpointsOpenshiftEtcd) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, hostEtcdServiceEndpointsOpenshiftEtcdFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
Expand Down
24 changes: 12 additions & 12 deletions pkg/asset/templates/content/bootkube/host-etcd-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import (
)

const (
hostEtcdServiceKubeSystemFileName = "host-etcd-service.yaml"
hostEtcdServiceOpenshiftEtcdFileName = "host-etcd-service.yaml"
)

var _ asset.WritableAsset = (*HostEtcdServiceKubeSystem)(nil)
var _ asset.WritableAsset = (*HostEtcdServiceOpenshiftEtcd)(nil)

// HostEtcdServiceKubeSystem is the constant to represent contents of etcd-service.yaml file
type HostEtcdServiceKubeSystem struct {
// HostEtcdServiceOpenshiftEtcd is the constant to represent contents of etcd-service.yaml file
type HostEtcdServiceOpenshiftEtcd struct {
FileList []*asset.File
}

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

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

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

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

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