From 6609d3338d6736590d929594b0ab2c9d08bca39a Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Fri, 7 Jul 2017 09:46:21 -0700 Subject: [PATCH 1/6] import from rawhide --- Dockerfile | 22 ++++++ config.json.template | 184 +++++++++++++++++++++++++++++++++++++++++++ launch.sh | 8 ++ service.template | 12 +++ 4 files changed, 226 insertions(+) create mode 100644 Dockerfile create mode 100644 config.json.template create mode 100644 launch.sh create mode 100644 service.template diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70da97e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.fedoraproject.org/f26/kubernetes-master:latest +MAINTAINER "Jason Brooks" + +ENV container=docker + +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=0 ARCH=x86_64 +LABEL BZComponent="$NAME" \ + name="$FGC/$NAME" \ + version="$VERSION" \ + release="$RELEASE.$DISTTAG" \ + architecture="$ARCH" \ + atomic.type='system' + +COPY launch.sh /usr/bin/kube-controller-manager-docker.sh + +LABEL RUN /usr/bin/docker run -d --net=host + +COPY service.template config.json.template /exports/ + +RUN mkdir -p /exports/hostfs/etc/kubernetes && cp /etc/kubernetes/{config,controller-manager} /exports/hostfs/etc/kubernetes + +ENTRYPOINT ["/usr/bin/kube-controller-manager-docker.sh"] diff --git a/config.json.template b/config.json.template new file mode 100644 index 0000000..bc7e6a8 --- /dev/null +++ b/config.json.template @@ -0,0 +1,184 @@ +{ + "ociVersion": "1.0.0", + "platform": { + "os": "linux", + "arch": "amd64" + }, + "process": { + "terminal": false, + "user": { + "uid": 994, + "gid": 996 + }, + "args": [ + "/usr/bin/kube-controller-manager-docker.sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE", + "CAP_DAC_READ_SEARCH" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE", + "CAP_DAC_READ_SEARCH" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE", + "CAP_DAC_READ_SEARCH" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE", + "CAP_DAC_READ_SEARCH" + ], + "ambient": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE", + "CAP_DAC_READ_SEARCH" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ] + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + }, + { + "type": "bind", + "source": "/etc/kubernetes", + "destination": "/etc/kubernetes", + "options": [ + "rbind", + "ro", + "rprivate" + ] + }, + { + "destination": "/etc/resolv.conf", + "type": "bind", + "source": "/etc/resolv.conf", + "options": [ + "ro", + "rbind", + "rprivate" + ] + } + ], + "linux": { + "resources": { + "devices": [ + { + "allow": false, + "access": "rwm" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "ipc" + }, + { + "type": "mount" + } + ], + "devices": null, + "apparmorProfile": "", + "selinuxProcessLabel": "" + } +} diff --git a/launch.sh b/launch.sh new file mode 100644 index 0000000..f75107c --- /dev/null +++ b/launch.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +source /etc/kubernetes/controller-manager +source /etc/kubernetes/config + +ARGS=$(echo "$@ $KUBE_LOGTOSTDERR $KUBE_LOG_LEVEL $KUBE_MASTER $KUBE_CONTROLLER_MANAGER_ARGS" | xargs -n1 | sort -u -t = -k 1,1 | xargs) + +exec /usr/bin/kube-controller-manager $ARGS diff --git a/service.template b/service.template new file mode 100644 index 0000000..d73b0b3 --- /dev/null +++ b/service.template @@ -0,0 +1,12 @@ +[Unit] +Description=kubernetes-controller-manager + +[Service] +ExecStart=$EXEC_START +ExecStop=$EXEC_STOP +Restart=on-failure +WorkingDirectory=$DESTDIR + +[Install] +WantedBy=multi-user.target + From 4ff605b1c1ba60b622247f7af0fa9b15ce2fa108 Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Wed, 16 Aug 2017 18:31:39 -0700 Subject: [PATCH 2/6] make init script executable --- Dockerfile | 2 +- launch.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 launch.sh diff --git a/Dockerfile b/Dockerfile index 70da97e..44be455 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=0 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=1 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ diff --git a/launch.sh b/launch.sh old mode 100644 new mode 100755 From c31d52d28c7cb5669b4ba828e3582f1712d2c12e Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 24 Aug 2017 18:01:51 -0500 Subject: [PATCH 3/6] Bump RELEASE for automatic rebuild --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44be455..a2056fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=1 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=2 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ From 19b57ba82af8af0c186589ee836b16a1bacd5ea2 Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Tue, 5 Sep 2017 11:11:22 -0700 Subject: [PATCH 4/6] fix uid/gid --- Dockerfile | 2 +- config.json.template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2056fa..4ac2bbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=2 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=3 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ diff --git a/config.json.template b/config.json.template index bc7e6a8..27cb6e9 100644 --- a/config.json.template +++ b/config.json.template @@ -7,8 +7,8 @@ "process": { "terminal": false, "user": { - "uid": 994, - "gid": 996 + "uid": 996, + "gid": 994 }, "args": [ "/usr/bin/kube-controller-manager-docker.sh" From 3dc8bff86168282057ae2c63f907564ff460690b Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 21 Sep 2017 15:06:35 -0500 Subject: [PATCH 5/6] Bump RELEASE for automatic rebuild --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4ac2bbc..79e3412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=3 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=4 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ From 249b6aa78de77cfb810271c1175ec20267bd4db4 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Tue, 14 Nov 2017 16:42:55 -0600 Subject: [PATCH 6/6] Bump RELEASE for automatic rebuild --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 79e3412..83dc2a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=4 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=5 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \