From 3663f9680f3fc99bb9c4ce8f1436695ef231912b Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Thu, 6 Jul 2017 12:29:55 -0700 Subject: [PATCH 1/8] initial commit --- 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..cbc035e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.fedoraproject.org/kubernetes-master:rawhide +MAINTAINER "Jason Brooks" + +ENV container=docker + +ENV NAME=kubernetes-controller-manager VERSION=0.1 RELEASE=8 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 2a156f42e98fcaa937d5420c3757699cc9b3b94f Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Thu, 6 Jul 2017 13:02:17 -0700 Subject: [PATCH 2/8] fix BZComponent capitalization --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cbc035e..1f78297 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ MAINTAINER "Jason Brooks" ENV container=docker ENV NAME=kubernetes-controller-manager VERSION=0.1 RELEASE=8 ARCH=x86_64 -LABEL bzcomponent="$NAME" \ +LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ release="$RELEASE.$DISTTAG" \ From 62d3628bae4367f8d54f6909af5e651b35741ca2 Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Thu, 6 Jul 2017 13:59:39 -0700 Subject: [PATCH 3/8] build from f27 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1f78297..41abf8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/kubernetes-master:rawhide +FROM registry.fedoraproject.org/f27/kubernetes-master:latest MAINTAINER "Jason Brooks" ENV container=docker From e0a5a8c8c9233fd5647a0c714ffe54c99c509f9b Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Mon, 24 Jul 2017 18:14:30 -0700 Subject: [PATCH 4/8] don't sort args --- launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch.sh b/launch.sh index f75107c..3b38c36 100644 --- a/launch.sh +++ b/launch.sh @@ -3,6 +3,6 @@ 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) +ARGS="$@ $KUBE_LOGTOSTDERR $KUBE_LOG_LEVEL $KUBE_MASTER $KUBE_CONTROLLER_MANAGER_ARGS" exec /usr/bin/kube-controller-manager $ARGS From 8ba1a699d7ba24bd2cf91b6e4a8c37049428ba7a Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Tue, 28 Nov 2017 12:56:03 -0800 Subject: [PATCH 5/8] fix uid/gid, make launch script executable --- Dockerfile | 4 ++-- config.json.template | 4 ++-- launch.sh | 0 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 launch.sh diff --git a/Dockerfile b/Dockerfile index 41abf8f..9d0342d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM registry.fedoraproject.org/f27/kubernetes-master:latest +FROM registry.fedoraproject.org/kubernetes-master:rawhide MAINTAINER "Jason Brooks" ENV container=docker -ENV NAME=kubernetes-controller-manager VERSION=0.1 RELEASE=8 ARCH=x86_64 +ENV NAME=kubernetes-controller-manager VERSION=0 RELEASE=0 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" diff --git a/launch.sh b/launch.sh old mode 100644 new mode 100755 From 228f8cf8bbc32f83fe93e3835eb66c3012e02ef3 Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Tue, 20 Mar 2018 12:55:06 -0700 Subject: [PATCH 6/8] from f28 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d0342d..e86a1c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/kubernetes-master:rawhide +FROM registry.fedoraproject.org/kubernetes-master:28 MAINTAINER "Jason Brooks" ENV container=docker From f5ffaecff4203e20562acab09a5de23fafb178bf Mon Sep 17 00:00:00 2001 From: Jason Brooks Date: Tue, 20 Mar 2018 12:55:47 -0700 Subject: [PATCH 7/8] revert --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e86a1c0..9d0342d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.fedoraproject.org/kubernetes-master:28 +FROM registry.fedoraproject.org/kubernetes-master:rawhide MAINTAINER "Jason Brooks" ENV container=docker From ca8e0e2c97daf1745de8c37572be833455fed6c8 Mon Sep 17 00:00:00 2001 From: Bhavin Gandhi Date: Thu, 23 Aug 2018 23:03:06 +0530 Subject: [PATCH 8/8] Drop Release label in favor of OSBS release_bump plugin OSBS can automatically bump the release number, for that we just need to drop the label from the Dockerfile See https://pagure.io/ContainerSIG/container-sig/issue/1 Signed-off-by: Bhavin Gandhi --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d0342d..5889463 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,10 @@ 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 ARCH=x86_64 LABEL BZComponent="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ - release="$RELEASE.$DISTTAG" \ architecture="$ARCH" \ atomic.type='system'