diff --git a/manifests/bootstrap-pod-v2.yaml b/manifests/bootstrap-pod-v2.yaml new file mode 100644 index 0000000000..03d1f35ace --- /dev/null +++ b/manifests/bootstrap-pod-v2.yaml @@ -0,0 +1,61 @@ +apiVersion: v1 +kind: Pod +metadata: + name: bootstrap-machine-config-operator + namespace: {{.TargetNamespace}} +spec: + initContainers: + - name: machine-config-controller + image: {{.Images.MachineConfigController}} + args: + - "bootstrap" + - "--manifest-dir=/etc/mcc/bootstrap" + - "--dest-dir=/etc/mcs/bootstrap" + - "--pull-secret=/etc/mcc/bootstrap/machineconfigcontroller-pull-secret" + resources: + limits: + cpu: 20m + memory: 50Mi + requests: + cpu: 20m + memory: 50Mi + securityContext: + privileged: true + volumeMounts: + - name: bootstrap-manifests + mountPath: /etc/mcc/bootstrap + - name: server-basedir + mountPath: /etc/mcs/bootstrap + containers: + - name: machine-config-server + image: {{.Images.MachineConfigServer}} + args: + - "bootstrap" + volumeMounts: + - name: server-certs + mountPath: /etc/ssl/mcs + - name: bootstrap-kubeconfig + mountPath: /etc/kubernetes/kubeconfig + - name: server-basedir + mountPath: /etc/mcs/bootstrap + securityContext: + privileged: true + hostNetwork: true + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + restartPolicy: Always + volumes: + - name: server-certs + hostPath: + path: /etc/ssl/mcs + - name: bootstrap-kubeconfig + hostPath: + path: /etc/mcs/kubeconfig + - name: server-basedir + hostPath: + path: /etc/mcs/bootstrap + - name: bootstrap-manifests + hostPath: + path: /etc/mcc/bootstrap diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go index 72cfa4a3c9..4214f04521 100644 --- a/pkg/operator/assets/bindata.go +++ b/pkg/operator/assets/bindata.go @@ -1,5 +1,6 @@ // Code generated by go-bindata. // sources: +// manifests/bootstrap-pod-v2.yaml // manifests/bootstrap-pod.yaml // manifests/controllerconfig.crd.yaml // manifests/machineconfig.crd.yaml @@ -71,6 +72,84 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } +var _manifestsBootstrapPodV2Yaml = []byte(`apiVersion: v1 +kind: Pod +metadata: + name: bootstrap-machine-config-operator + namespace: {{.TargetNamespace}} +spec: + initContainers: + - name: machine-config-controller + image: {{.Images.MachineConfigController}} + args: + - "bootstrap" + - "--manifest-dir=/etc/mcc/bootstrap" + - "--dest-dir=/etc/mcs/bootstrap" + - "--pull-secret=/etc/mcc/bootstrap/machineconfigcontroller-pull-secret" + resources: + limits: + cpu: 20m + memory: 50Mi + requests: + cpu: 20m + memory: 50Mi + securityContext: + privileged: true + volumeMounts: + - name: bootstrap-manifests + mountPath: /etc/mcc/bootstrap + - name: server-basedir + mountPath: /etc/mcs/bootstrap + containers: + - name: machine-config-server + image: {{.Images.MachineConfigServer}} + args: + - "bootstrap" + volumeMounts: + - name: server-certs + mountPath: /etc/ssl/mcs + - name: bootstrap-kubeconfig + mountPath: /etc/kubernetes/kubeconfig + - name: server-basedir + mountPath: /etc/mcs/bootstrap + securityContext: + privileged: true + hostNetwork: true + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + restartPolicy: Always + volumes: + - name: server-certs + hostPath: + path: /etc/ssl/mcs + - name: bootstrap-kubeconfig + hostPath: + path: /etc/mcs/kubeconfig + - name: server-basedir + hostPath: + path: /etc/mcs/bootstrap + - name: bootstrap-manifests + hostPath: + path: /etc/mcc/bootstrap +`) + +func manifestsBootstrapPodV2YamlBytes() ([]byte, error) { + return _manifestsBootstrapPodV2Yaml, nil +} + +func manifestsBootstrapPodV2Yaml() (*asset, error) { + bytes, err := manifestsBootstrapPodV2YamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "manifests/bootstrap-pod-v2.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _manifestsBootstrapPodYaml = []byte(`apiVersion: v1 kind: Pod metadata: @@ -1100,6 +1179,7 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ + "manifests/bootstrap-pod-v2.yaml": manifestsBootstrapPodV2Yaml, "manifests/bootstrap-pod.yaml": manifestsBootstrapPodYaml, "manifests/controllerconfig.crd.yaml": manifestsControllerconfigCrdYaml, "manifests/machineconfig.crd.yaml": manifestsMachineconfigCrdYaml, @@ -1171,6 +1251,7 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ "manifests": &bintree{nil, map[string]*bintree{ + "bootstrap-pod-v2.yaml": &bintree{manifestsBootstrapPodV2Yaml, map[string]*bintree{}}, "bootstrap-pod.yaml": &bintree{manifestsBootstrapPodYaml, map[string]*bintree{}}, "controllerconfig.crd.yaml": &bintree{manifestsControllerconfigCrdYaml, map[string]*bintree{}}, "machineconfig.crd.yaml": &bintree{manifestsMachineconfigCrdYaml, map[string]*bintree{}}, diff --git a/pkg/operator/bootstrap.go b/pkg/operator/bootstrap.go index 30e8d7cdc8..c9778ee78c 100644 --- a/pkg/operator/bootstrap.go +++ b/pkg/operator/bootstrap.go @@ -63,6 +63,28 @@ func RenderBootstrap( }, { data: filesData[pullSecretFile], filename: "manifests/machineconfigcontroller-pull-secret", + }, { + // new directories for mco bootstrapping. + name: "manifests/machineconfigcontroller/controllerconfig.yaml", + filename: "bootstrap/manifests/machineconfigcontroller-controllerconfig.yaml", + }, { + name: "manifests/master.machineconfigpool.yaml", + filename: "bootstrap/manifests/master.machineconfigpool.yaml", + }, { + name: "manifests/worker.machineconfigpool.yaml", + filename: "bootstrap/manifests/worker.machineconfigpool.yaml", + }, { + name: "manifests/bootstrap-pod-v2.yaml", + filename: "bootstrap/machineconfigoperator-bootstrap-pod.yaml", + }, { + data: filesData[pullSecretFile], + filename: "bootstrap/manifests/machineconfigcontroller-pull-secret", + }, { + name: "manifests/machineconfigserver/csr-approver-role-binding.yaml", + filename: "manifests/csr-approver-role-binding.yaml", + }, { + name: "manifests/machineconfigserver/csr-bootstrap-role-binding.yaml", + filename: "manifests/csr-bootstrap-role-binding.yaml", }} for _, m := range manifests { glog.Info(m)