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
1 change: 1 addition & 0 deletions Dockerfile.machine-config-operator
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ RUN WHAT=machine-config-operator ./hack/build-go.sh

FROM scratch
COPY --from=build-env /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-operator /bin/machine-config-operator
COPY install /manifests

ENTRYPOINT ["/bin/machine-config-operator"]
4 changes: 2 additions & 2 deletions cmd/machine-config-controller/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var (
bootstrapCmd = &cobra.Command{
Use: "boostrap",
Use: "bootstrap",
Short: "Starts Machine Config Controller in bootstrap mode",
Long: "",
Run: runbootstrapCmd,
Expand All @@ -27,7 +27,7 @@ var (
func init() {
rootCmd.AddCommand(bootstrapCmd)
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.destinationDir, "dest-dir", "", "The destination dir where MCC writes the generated machineconfigs and machineconfigpools.")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.manifestsDir, "mainfest-dir", "", "The dir where MCC reads the controllerconfig, machineconfigpools and user-defined machineconfigs.")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.manifestsDir, "manifest-dir", "", "The dir where MCC reads the controllerconfig, machineconfigpools and user-defined machineconfigs.")

}

Expand Down
Empty file removed install/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions install/00_namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-machine-config-operator
labels:
name: openshift-machine-config-operator
openshift.io/run-level: "1"
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions install/03_rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-account-openshift-machine-config-operator
subjects:
- kind: ServiceAccount
name: default
namespace: openshift-machine-config-operator
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
57 changes: 57 additions & 0 deletions install/04_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: machine-config-operator
namespace: openshift-machine-config-operator
labels:
k8s-app: machine-config-operator
spec:
replicas: 1
selector:
matchLabels:
k8s-app: machine-config-operator
template:
metadata:
labels:
k8s-app: machine-config-operator
spec:
containers:
- name: machine-config-operator
image: ${machine_config_operator_image}
args:
- "start"
- "--images-json=/etc/mco/images/images.json"
resources:
limits:
cpu: 20m
memory: 50Mi
requests:
cpu: 20m
memory: 50Mi
volumeMounts:
- name: root-ca
mountPath: /etc/ssl/kubernetes/ca.crt
- name: etcd-ca
mountPath: /etc/ssl/etcd/ca.crt
- name: images
mountPath: /etc/mco/images
nodeSelector:
node-role.kubernetes.io/master: ""
restartPolicy: Always
securityContext:
runAsNonRoot: true
runAsUser: 65534
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
volumes:
- name: images
configMap:
name: machine-config-operator-images
- name: etcd-ca
hostPath:
path: /etc/ssl/etcd/ca.crt
- name: root-ca
hostPath:
path: /etc/kubernetes/ca.crt
65 changes: 65 additions & 0 deletions manifests/bootstrap-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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/manifests"
- "--dest-dir=/etc/mcc/bootstrap/server"
resources:
limits:
cpu: 20m
memory: 50Mi
requests:
cpu: 20m
memory: 50Mi
securityContext:
privileged: true
volumeMounts:
- name: bootstrap-manifests
mountPath: /etc/mcc/bootstrap/manifests
- name: server-basedir
mountPath: /etc/mcc/bootstrap/server
containers:
- name: machine-config-server
image: {{.Images.MachineConfigServer}}
args:
- "bootstrap"
volumeMounts:
- name: certs
mountPath: /etc/ssl/mcs
- name: etc-kubernetes
mountPath: /etc/kubernetes/kubeconfig
- name: server-basedir
mountPath: /etc/mcs/bootstrap
- name: etcd-certs
mountPath: /etc/ssl/etcd
securityContext:
privileged: true
hostNetwork: true
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
restartPolicy: Always
volumes:
- name: certs
hostPath:
path: /etc/ssl/mcs
- name: etc-kubernetes
hostPath:
path: /etc/kubernetes/kubeconfig
- name: server-basedir
hostPath:
path: /etc/mcs/bootstrap
- name: etcd-certs
hostPath:
path: /etc/ssl/etcd
- name: bootstrap-manifests
hostPath:
path: /etc/mcc/bootstrap/manifests
11 changes: 0 additions & 11 deletions manifests/etcd.machineconfigpool.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions manifests/machineconfigcontroller/bootstrap-pod.yaml

This file was deleted.

46 changes: 24 additions & 22 deletions manifests/machineconfigdaemon/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,30 @@ spec:
k8s-app: machine-config-daemon
spec:
containers:
- name: machine-config-daemon
image: {{.Images.MachineConfigDaemon}}
args:
- "start"
volumeMounts:
- mountPath: /rootfs
name: rootfs
- mountPath: /var/run/dbus
name: var-run-dbus
- mountPath: /run/systemd
name: run-systemd
- mountPath: /etc/ssl/certs
name: etc-ssl-certs
readOnly: true
- mountPath: /etc/machine-config-daemon
name: etc-mcd
readOnly: true
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: machine-config-daemon
image: {{.Images.MachineConfigDaemon}}
args:
- "start"
securityContext:
privileged: true
volumeMounts:
- mountPath: /rootfs
name: rootfs
- mountPath: /var/run/dbus
name: var-run-dbus
- mountPath: /run/systemd
name: run-systemd
- mountPath: /etc/ssl/certs
name: etc-ssl-certs
readOnly: true
- mountPath: /etc/machine-config-daemon
name: etc-mcd
readOnly: true
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
serviceAccountName: machine-config-daemon
tolerations:
- key: node-role.kubernetes.io/master
Expand Down
39 changes: 0 additions & 39 deletions manifests/machineconfigserver/bootstrap-pod.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/machineconfigserver/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
namespace: {{.TargetNamespace}}
rules:
- apiGroups: ["machineconfiguration.openshift.io"]
resources: ["machineconfigs"]
resources: ["machineconfigs", "machineconfigpools"]
verbs: ["*"]
20 changes: 10 additions & 10 deletions manifests/machineconfigserver/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ spec:
k8s-app: machine-config-server
spec:
containers:
- name: machine-config-server
image: {{.Images.MachineConfigServer}}
args:
- "start"
- "--apiserver-url=https://{{.ControllerConfig.ClusterName}}-api.{{.ControllerConfig.BaseDomain}}:6443"
volumeMounts:
- name: certs
mountPath: /etc/ssl/mcs
- name: node-bootstrap-token
mountPath: /etc/mcs/bootstrap-token
- name: machine-config-server
image: {{.Images.MachineConfigServer}}
args:
- "start"
- "--apiserver-url=https://{{.ControllerConfig.ClusterName}}-api.{{.ControllerConfig.BaseDomain}}:6443"
volumeMounts:
- name: certs
mountPath: /etc/ssl/mcs
- name: node-bootstrap-token
mountPath: /etc/mcs/bootstrap-token
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/master: ""
Expand Down
2 changes: 1 addition & 1 deletion manifests/machineconfigserver/node-bootstrapper-token.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
kubernetes.io/service-account.name: node-bootstrapper
name: node-bootstrapper-token
namespace: {{.TargetNamespace}}
type: kubernetes.io/service-account-token
type: kubernetes.io/service-account-token
5 changes: 4 additions & 1 deletion pkg/controller/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (b *Bootstrap) Run(destDir string) error {
}
}

if cconfig == nil {
return fmt.Errorf("error: no controllerconfig found in dir: %q", destDir)
}
iconfigs, err := template.RunBootstrap(b.templatesDir, cconfig)
if err != nil {
return err
Expand Down Expand Up @@ -100,7 +103,7 @@ func (b *Bootstrap) Run(destDir string) error {
}

configdir := filepath.Join(destDir, "machine-configs")
if err := os.MkdirAll(poolsdir, 0664); err != nil {
if err := os.MkdirAll(configdir, 0664); err != nil {
return err
}
for _, c := range gconfigs {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading