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
22 changes: 11 additions & 11 deletions cmd/machine-config-controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ func startControllers(ctx *common.ControllerContext) error {
ctx.ClientBuilder.MachineConfigClientOrDie("kubelet-config-controller"),
).Run(2, ctx.Stop)

go containerruntimeconfig.New(
rootOpts.templates,
ctx.InformerFactory.Machineconfiguration().V1().MachineConfigPools(),
ctx.InformerFactory.Machineconfiguration().V1().ControllerConfigs(),
ctx.InformerFactory.Machineconfiguration().V1().ContainerRuntimeConfigs(),
ctx.ConfigInformerFactory.Config().V1().Images(),
ctx.ClientBuilder.KubeClientOrDie("container-runtime-config-controller"),
ctx.ClientBuilder.MachineConfigClientOrDie("container-runtime-config-controller"),
ctx.ClientBuilder.ConfigClientOrDie("container-runtime-config-controller"),
).Run(2, ctx.Stop)

// The renderer creates "rendered" MCs from the MC fragments generated by
// the above sub-controllers, which are then consumed by the node controller
go render.New(
Expand All @@ -117,16 +128,5 @@ func startControllers(ctx *common.ControllerContext) error {
ctx.ClientBuilder.MachineConfigClientOrDie("node-update-controller"),
).Run(2, ctx.Stop)

go containerruntimeconfig.New(
rootOpts.templates,
ctx.InformerFactory.Machineconfiguration().V1().MachineConfigPools(),
ctx.InformerFactory.Machineconfiguration().V1().ControllerConfigs(),
ctx.InformerFactory.Machineconfiguration().V1().ContainerRuntimeConfigs(),
ctx.ConfigInformerFactory.Config().V1().Images(),
ctx.ClientBuilder.KubeClientOrDie("container-runtime-config-controller"),
ctx.ClientBuilder.MachineConfigClientOrDie("container-runtime-config-controller"),
ctx.ClientBuilder.ConfigClientOrDie("container-runtime-config-controller"),
).Run(2, ctx.Stop)

return nil
}
2 changes: 2 additions & 0 deletions cmd/machine-config-operator/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func init() {
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.setupEtcdEnvImage, "setup-etcd-env-image", "", "Image for Setup Etcd Environment.")
bootstrapCmd.MarkFlagRequired("setup-etcd-env-image")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.infraImage, "infra-image", "quay.io/openshift/origin-pod:v4.0", "Image for Infra Containers.")
bootstrapCmd.MarkFlagRequired("infra-image")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.configFile, "config-file", "", "ClusterConfig ConfigMap file.")
bootstrapCmd.MarkFlagRequired("config-file")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.infraConfigFile, "infra-config-file", "/assets/manifests/cluster-infrastructure-02-config.yml", "File containing infrastructure.config.openshift.io manifest.")
Expand All @@ -84,6 +85,7 @@ func runBootstrapCmd(cmd *cobra.Command, args []string) {
MachineOSContent: bootstrapOpts.oscontentImage,
Etcd: bootstrapOpts.etcdImage,
SetupEtcdEnv: bootstrapOpts.setupEtcdEnvImage,
InfraImage: bootstrapOpts.infraImage,
}

if err := operator.RenderBootstrap(
Expand Down
2 changes: 0 additions & 2 deletions docs/ContainerRuntimeConfigDesign.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ The following goals should not require explicit knowledge of a customer to know

3. Setting max log size

4. Setting the infra image

## Non-Goals

# Proposal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ data:
"machineConfigDaemon": "docker.io/openshift/origin-machine-config-daemon:v4.0.0",
"machineConfigServer": "docker.io/openshift/origin-machine-config-server:v4.0.0",
"etcd": "quay.io/coreos/etcd:v3.3.10",
"setupEtcdEnv": "registry.svc.ci.openshift.org/openshift/origin-v4.0:setup-etcd-environment"
"setupEtcdEnv": "registry.svc.ci.openshift.org/openshift/origin-v4.0:setup-etcd-environment",
"infraImage": "quay.io/openshift/origin-pod:v4.0"
}
1 change: 0 additions & 1 deletion pkg/apis/machineconfiguration.openshift.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ type ContainerRuntimeConfiguration struct {
PidsLimit int64 `json:"pidsLimit,omitempty"`
LogLevel string `json:"logLevel,omitempty"`
LogSizeMax resource.Quantity `json:"logSizeMax,omitempty"`
InfraImage string `json:"infraImage,omitempty"`
OverlaySize resource.Quantity `json:"overlaySize,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ func (ctrl *Controller) syncContainerRuntimeConfig(key string) error {
glog.V(2).Infoln(cfg, err, "error merging user changes to storage.conf: %v", err)
}
}
if ctrcfg.LogLevel != "" || ctrcfg.InfraImage != "" || ctrcfg.PidsLimit != 0 || ctrcfg.LogSizeMax != (resource.Quantity{}) {
if ctrcfg.LogLevel != "" || ctrcfg.PidsLimit != 0 || ctrcfg.LogSizeMax != (resource.Quantity{}) {
crioTOML, err = ctrl.mergeConfigChanges(originalCRIOIgn, cfg, mc, role, managedKey, isNotFound, updateCRIOConfig)
if err != nil {
glog.V(2).Infoln(cfg, err, "error merging user changes to crio.conf: %v", err)
Expand Down
3 changes: 0 additions & 3 deletions pkg/controller/container-runtime-config/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ func updateCRIOConfig(data []byte, internal *mcfgv1.ContainerRuntimeConfiguratio
if internal.LogLevel != "" {
tomlConf.Crio.Runtime.LogLevel = internal.LogLevel
}
if internal.InfraImage != "" {
tomlConf.Crio.Image.PauseImage = internal.InfraImage
}
// For some reason, when the crio.conf file is created storage_option is not included
// in the file. Noticed the same thing for all fields in the struct that are of type []string
// and are empty. This is a dumb hack for now to ensure that cri-o doesn't blow up when
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/template/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ const (

// SetupEtcdEnvKey is the key that references the setup-etcd-environment image in the controller
SetupEtcdEnvKey string = "setupEtcdEnv"

// InfraImageKey is the key that references the infra image in the controller for crio.conf
InfraImageKey string = "infraImage"
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ spec:
images:
etcd: image/etcd:1
setupEtcdEnv: image/setupEtcdEnv:1
infraImage: image/infraImage:1
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ spec:
images:
etcd: image/etcd:1
setupEtcdEnv: image/setupEtcdEnv:1
infraImage: image/infraImage:1
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ spec:
images:
etcd: image/etcd:1
setupEtcdEnv: image/setupEtcdEnv:1
infraImage: image/infraImage:1
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ spec:
images:
etcd: image/etcd:1
setupEtcdEnv: image/setupEtcdEnv:1
infraImage: image/infraImage:1

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/operator/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func RenderBootstrap(
spec.Images = map[string]string{
templatectrl.EtcdImageKey: imgs.Etcd,
templatectrl.SetupEtcdEnvKey: imgs.SetupEtcdEnv,
templatectrl.InfraImageKey: imgs.InfraImage,
}

config := getRenderConfig("", spec, imgs, infra.Status.APIServerURL)
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ type Images struct {
MachineOSContent string `json:"machineOSContent"`
Etcd string `json:"etcd"`
SetupEtcdEnv string `json:"setupEtcdEnv"`
InfraImage string `json:"infraImage"`
}
1 change: 1 addition & 0 deletions pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func (optr *Operator) sync(key string) error {
spec.Images = map[string]string{
templatectrl.EtcdImageKey: imgs.Etcd,
templatectrl.SetupEtcdEnvKey: imgs.SetupEtcdEnv,
templatectrl.InfraImageKey: imgs.InfraImage,
}

// create renderConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ contents:
default_transport = "docker://"

# pause_image is the image which we use to instantiate infra containers.
pause_image = "k8s.gcr.io/pause:3.1"
pause_image = "{{.Images.infraImage}}"

# pause_command is the command to run in a pause_image to have a container just
# sit there. If the image contains the necessary information, this value need
# not be specified.
pause_command = "/pause"
pause_command = "/usr/bin/pod"

# signature_policy is the name of the file which decides what sort of policy we
# use when deciding whether or not to trust an image that we've pulled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ contents:
default_transport = "docker://"

# pause_image is the image which we use to instantiate infra containers.
pause_image = "k8s.gcr.io/pause:3.1"
pause_image = "{{.Images.infraImage}}"

# pause_command is the command to run in a pause_image to have a container just
# sit there. If the image contains the necessary information, this value need
# not be specified.
pause_command = "/pause"
pause_command = "/usr/bin/pod"

# signature_policy is the name of the file which decides what sort of policy we
# use when deciding whether or not to trust an image that we've pulled.
Expand Down