jcapik pushed to kubernetes (f21). "bump to upstream d5377e4a394b4fc6e3088634729b538eac124b1b (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed Jun 10 14:46:19 UTC 2015


From 4596a2657837858753e60f1d01a3e92c14b29574 Mon Sep 17 00:00:00 2001
From: Eric Paris <eparis at redhat.com>
Date: Mon, 20 Oct 2014 11:05:02 -0400
Subject: bump to upstream d5377e4a394b4fc6e3088634729b538eac124b1b

add bash completions for kubectl
use systemd and environment variabled from in tree

diff --git a/.gitignore b/.gitignore
index 76e5687..a2b9494 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /kubernetes-98ac8e1.tar.gz
 /kubernetes-4452163.tar.gz
 /kubernetes-b011263.tar.gz
+/kubernetes-d5377e4.tar.gz
diff --git a/apiserver b/apiserver
deleted file mode 100644
index 204fe57..0000000
--- a/apiserver
+++ /dev/null
@@ -1,26 +0,0 @@
-###
-# kubernetes system config
-#
-# The following values are used to configure the kubernetes-apiserver
-#
-
-# The address on the local server to listen to.
-KUBE_API_ADDRESS="--address=127.0.0.1"
-
-# The port on the local server to listen on.
-KUBE_API_PORT="--port=8080"
-
-# How the replication controller and scheduler find the apiserver
-KUBE_MASTER="--master=127.0.0.1:8080"
-
-# Comma seperated list of minions
-MINION_ADDRESSES="--machines=127.0.0.1"
-
-# Port minions listen on
-MINION_PORT="--minion_port=10250"
-
-# Address range to use for services
-KUBE_SERVICE_ADDRESSES="--portal_net=10.254.0.0/16"
-
-# Add you own!
-KUBE_API_ARGS=""
diff --git a/config b/config
deleted file mode 100644
index c96170c..0000000
--- a/config
+++ /dev/null
@@ -1,23 +0,0 @@
-###
-# kubernetes system config
-#
-# The following values are used to configure various aspects of all
-# kubernetes services, including
-#
-#   kubernetes-apiserver.service
-#   kubernetes-controller-manager.service
-#   kubernetes-scheduler.service
-#   kubelet.service
-#   kubernetes-proxy.service
-
-# Comma seperated list of nodes in the etcd cluster
-KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001"
-
-# logging to stderr means we get it in the systemd journal
-KUBE_LOGTOSTDERR="--logtostderr=true"
-
-# journal message level, 0 is debug
-KUBE_LOG_LEVEL="--v=0"
-
-# Should this cluster be allowed to run privleged docker containers
-KUBE_ALLOW_PRIV="--allow_privileged=false"
diff --git a/controller-manager b/controller-manager
deleted file mode 100644
index 8d8f491..0000000
--- a/controller-manager
+++ /dev/null
@@ -1,7 +0,0 @@
-###
-# The following values are used to configure the kubernetes controller-manager
-
-# defaults from config and apiserver should be adequate
-
-# Add you own!
-KUBE_CONTROLLER_MANAGER_ARGS=""
diff --git a/kube-apiserver.service b/kube-apiserver.service
deleted file mode 100644
index cbd6ca4..0000000
--- a/kube-apiserver.service
+++ /dev/null
@@ -1,23 +0,0 @@
-[Unit]
-Description=Kubernetes API Server
-Documentation=https://github.com/GoogleCloudPlatform/kubernetes
-
-[Service]
-EnvironmentFile=-/etc/kubernetes/config
-EnvironmentFile=-/etc/kubernetes/apiserver
-User=kube
-ExecStart=/usr/bin/kube-apiserver \
-	    ${KUBE_LOGTOSTDERR} \
-	    ${KUBE_LOG_LEVEL} \
-	    ${KUBE_ETCD_SERVERS} \
-	    ${KUBE_API_ADDRESS} \
-	    ${KUBE_API_PORT} \
-	    ${MINION_ADDRESSES} \
-	    ${MINION_PORT} \
-	    ${KUBE_ALLOW_PRIV} \
-	    ${KUBE_SERVICE_ADDRESSES} \
-	    ${KUBE_API_ARGS}
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/kube-controller-manager.service b/kube-controller-manager.service
deleted file mode 100644
index 6c2bfb2..0000000
--- a/kube-controller-manager.service
+++ /dev/null
@@ -1,18 +0,0 @@
-[Unit]
-Description=Kubernetes Controller Manager
-Documentation=https://github.com/GoogleCloudPlatform/kubernetes
-
-[Service]
-EnvironmentFile=-/etc/kubernetes/config
-EnvironmentFile=-/etc/kubernetes/apiserver
-EnvironmentFile=-/etc/kubernetes/controller-manager
-User=kube
-ExecStart=/usr/bin/kube-controller-manager \
-	    ${KUBE_LOGTOSTDERR} \
-	    ${KUBE_LOG_LEVEL} \
-	    ${KUBE_MASTER} \
-	    ${KUBE_CONTROLLER_MANAGER_ARGS}
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/kube-proxy.service b/kube-proxy.service
deleted file mode 100644
index fcfc2e2..0000000
--- a/kube-proxy.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Kubernetes Kube-Proxy Server
-Documentation=https://github.com/GoogleCloudPlatform/kubernetes
-
-[Service]
-EnvironmentFile=-/etc/kubernetes/config
-EnvironmentFile=-/etc/kubernetes/proxy
-ExecStart=/usr/bin/kube-proxy \
-	    ${KUBE_LOGTOSTDERR} \
-	    ${KUBE_LOG_LEVEL} \
-	    ${KUBE_ETCD_SERVERS} \
-	    ${KUBE_PROXY_ARGS}
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/kube-scheduler.service b/kube-scheduler.service
deleted file mode 100644
index 6d123ed..0000000
--- a/kube-scheduler.service
+++ /dev/null
@@ -1,17 +0,0 @@
-[Unit]
-Description=Kubernetes Scheduler Plugin
-Documentation=https://github.com/GoogleCloudPlatform/kubernetes
-
-[Service]
-EnvironmentFile=-/etc/kubernetes/config
-EnvironmentFile=-/etc/kubernetes/apiserver
-EnvironmentFile=-/etc/kubernetes/scheduler
-ExecStart=/usr/bin/kube-scheduler \
-	    ${KUBE_LOGTOSTDERR} \
-	    ${KUBE_LOG_LEVEL} \
-	    ${KUBE_MASTER} \
-	    ${KUBE_SCHEDULER_ARGS}
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/kubectl b/kubectl
new file mode 100644
index 0000000..0a458a6
--- /dev/null
+++ b/kubectl
@@ -0,0 +1,305 @@
+#!bash
+#
+# bash completion file for core kubectl commands
+#
+# This script provides completion of non replication controller options
+#
+# To enable the completions either:
+#  - place this file in /etc/bash_completion.d
+#  or
+#  - copy this file and add the line below to your .bashrc after
+#    bash completion features are loaded
+#     . kubectl
+#
+# Note:
+# Currently, the completions will not work if the apiserver daemon is not
+# running on localhost on the standard port 8080
+
+__contains_word()
+{
+    local w word=$1; shift
+    for w in "$@"; do
+        [[ $w = "$word" ]] && return
+    done
+    return 1
+}
+
+__has_resource()
+{
+    local all_resources=(pod pods service services minion minions replicationController replicationControllers)
+    local i
+    for ((i=command_word; i < cword; i++)); do
+        local word=${words[i]}
+        if __contains_word "${word}" "${all_resources[@]}"; then
+            return 0
+        fi
+    done
+    return 1
+}
+
+# call kubectl get $1,
+# exclude blank lines
+# skip the header stuff kubectl prints on the first 2 lines
+# append $1/ to the first column and use that in compgen
+__kubectl_parse_get()
+{
+    local kubectl_output out
+    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
+        out=($(echo "${kubectl_output}" | awk '{print $1}'))
+        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
+    fi
+}
+
+__kubectl_pre_command()
+{
+    local flags=(
+            --api-version=
+            -a
+            --auth-path=
+            --certificate-authority=
+            --client-certificate=
+            --client-key=
+            --insecure-skip-tls-verify=
+            --match-server-version=
+            -s
+            --server=
+    )
+    local api_versions=(v1beta1 v1beta2 v1beta3)
+
+    case $prev in
+        --api-version)
+            COMPREPLY=( $(compgen -W "${api_versions[*]}" -- "$cur") )
+            return 0
+            ;;
+        -a | --auth-path | --certificate-authority | --client-certificate | --client-key)
+            _filedir
+            return 0
+            ;;
+        --insecure-skip-tls-verify | --match-server-version)
+            COMPREPLY=( $(compgen -W "true false" -- "$cur") )
+            return 0
+            ;;
+        -s | --server)
+            return 0
+            ;;
+        *)
+            ;;
+    esac
+
+    if [[ "$cur" = -* ]]; then
+        compopt -o nospace
+        COMPREPLY=( $(compgen -W "${flags[*]}" -- "$cur") )
+        [[ $COMPREPLY == *= ]] || compopt +o nospace
+        return 0
+    fi
+
+    COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
+    return 0
+}
+
+__kubectl_require_file()
+{
+    local i has_file=false
+    local flags=(-f)
+    for ((i=command_word; i < cword; i++)); do
+        local word=${words[i]}
+        if [[ $word == -f ]]; then
+            flags=()
+        fi
+    done
+
+    case $prev in 
+        -f)
+            _filedir '@(json|yml|yaml)'
+            return 0;
+            ;;
+    esac
+    COMPREPLY=( $( compgen -W "${flags[*]}" -- "$cur" ) )
+}
+
+__kubectl_handle_flags_resources()
+{
+    case $prev in
+        pod | pods)
+            __kubectl_parse_get pods
+            return 0
+            ;;
+        replicationController | replicationControllers)
+            __kubectl_parse_get replicationControllers
+            return 0
+            ;;
+        service | services)
+            __kubectl_parse_get services
+            return 0
+            ;;
+        minion | minions)
+            __kubectl_parse_get minions
+            return 0
+            ;;
+    esac
+
+    case $cur in
+        -*)
+            compopt -o nospace
+            COMPREPLY=( $(compgen -W "${flags[*]}" -- "$cur") )
+            [[ $COMPREPLY == *= ]] || compopt +o nospace
+            return 0;
+            ;;
+    esac
+
+    COMPREPLY=( $(compgen -W "${resources[*]}" -- "$cur") )
+}
+
+__kubectl_get()
+{
+    local resources=()
+    local flags=(-o --output=)
+
+    if __has_resource; then
+        resource=()
+    else
+        resources=(pods minions services replicationControllers)
+    fi
+
+    for ((i=command_word; i < cword; i++)); do
+        local word=${words[i]}
+        local next=$(( $i + 1 ))
+        case $word in
+            -o | --output)
+                if [[ $next -lt $(( $cword )) ]] &&
+                   [[ ${words[$next]} == "template" ]]; then
+                    resources+=(-t --template=)
+                    flags=(-t --template=)
+                else
+                    flags=()
+                fi
+                ;;
+            -t | --templtate)
+                resources=(${resources[@]/--template=})
+                resources=(${resources[@]/-t})
+                flags=()
+                ;;
+        esac
+    done
+
+    case $prev in
+        -o | --output)
+            COMPREPLY=( $(compgen -W "table json yaml template" -- "$cur") )
+            return 0
+            ;;
+        -t | --template)
+            _filedir
+            return 0
+            ;;
+    esac
+    __kubectl_handle_flags_resources
+}
+
+__kubectl_describe()
+{
+    local resources=()
+    local flags=()
+
+    if __has_resource; then
+        resource=()
+    else
+        resources=(pods minions services replicationControllers)
+    fi
+    local resources=(pods minions services replicationControllers)
+
+    __kubectl_handle_flags_resources
+}
+
+__kubectl_delete()
+{
+    local resources=()
+    local flags=()
+
+    if __has_resource; then
+        resource=()
+        flags=()
+    else
+        resources=(pods minions services replicationControllers -f)
+        flags=(-f)
+    fi
+
+    for ((i=command_word; i < cword; i++)); do
+        local word=${words[i]}
+        if [[ $word == -f ]]; then
+            resources=()
+            flags=()
+        fi
+    done
+
+    case $prev in
+        -f)
+            _filedir '@(json|yml|yaml)'
+            return 0
+            ;;
+    esac
+    __kubectl_handle_flags_resources
+}
+
+__kubectl_post_command()
+{
+    case $command in
+        create | update)
+            __kubectl_require_file
+            return 0
+            ;;
+        get)
+            __kubectl_get
+            return 0
+            ;;
+        describe)
+            __kubectl_describe
+            return 0
+            ;;
+        delete)
+            __kubectl_delete
+            return 0
+            ;;
+        *)
+            ;;
+    esac
+}
+
+_kubectl()
+{
+    local command command_word
+    local cur prev words cword split
+    _init_completion -s -n : || return 0
+    _expand || return 0
+    COMPREPLY=()
+
+    local commands=(version proxy get describe create update delete help)
+    local two_word_flags=(
+            -a
+            -s
+    )
+
+    # figure out which command they are running, remembering that arguments to
+    # options don't count as the command!  So a hostname named 'create' won't
+    # trip things up
+    local i
+    for ((i=0; i < cword; i++)); do
+        if __contains_word "${words[i]}" "${commands[@]}" &&
+           ! __contains_word "${words[i-1]}" "${two_word_flags[@]}"; then
+            command=${words[i]}
+            command_word=i
+            break
+        fi
+    done
+
+    if [[ -z $command ]]; then
+        __kubectl_pre_command
+        return 0
+    fi
+
+    __kubectl_post_command
+
+    return 0
+}
+
+complete -F _kubectl kubectl
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/kubelet b/kubelet
deleted file mode 100644
index 1208038..0000000
--- a/kubelet
+++ /dev/null
@@ -1,14 +0,0 @@
-###
-# kubernetes kublet (minion) config
-
-# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
-MINION_ADDRESS="--address=127.0.0.1"
-
-# The port for the info server to serve on
-MINION_PORT="--port=10250"
-
-# You may leave this blank to use the actual hostname
-MINION_HOSTNAME="--hostname_override=127.0.0.1"
-
-# Add your own!
-MINION_ARGS=""
diff --git a/kubelet.service b/kubelet.service
deleted file mode 100644
index 6b26473..0000000
--- a/kubelet.service
+++ /dev/null
@@ -1,22 +0,0 @@
-[Unit]
-Description=Kubernetes Kubelet Server
-Documentation=https://github.com/GoogleCloudPlatform/kubernetes
-After=docker.socket cadvisor.service
-Requires=docker.socket
-
-[Service]
-EnvironmentFile=-/etc/kubernetes/config
-EnvironmentFile=-/etc/kubernetes/kubelet
-ExecStart=/usr/bin/kubelet \
-	    ${KUBE_LOGTOSTDERR} \
-	    ${KUBE_LOG_LEVEL} \
-	    ${KUBE_ETCD_SERVERS} \
-	    ${MINION_ADDRESS} \
-	    ${MINION_PORT} \
-	    ${MINION_HOSTNAME} \
-	    ${KUBE_ALLOW_PRIV} \
-	    ${MINION_ARGS}
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/kubernetes.spec b/kubernetes.spec
index 4de307e..cf5aab1 100644
--- a/kubernetes.spec
+++ b/kubernetes.spec
@@ -1,7 +1,7 @@
 #debuginfo not supported with Go
 %global debug_package	%{nil}
 %global import_path	github.com/GoogleCloudPlatform/kubernetes
-%global commit		b01126322b826a15db06f6eeefeeb56dc06db7af
+%global commit		d5377e4a394b4fc6e3088634729b538eac124b1b
 %global shortcommit	%(c=%{commit}; echo ${c:0:7})
 
 #binaries which should be called kube-*
@@ -18,26 +18,14 @@
 
 Name:		kubernetes
 Version:	0.4
-Release:	0.1.git%{shortcommit}%{?dist}
+Release:	0.2.git%{shortcommit}%{?dist}
 Summary:	Container cluster management
 License:	ASL 2.0
 URL:		https://github.com/GoogleCloudPlatform/kubernetes
 ExclusiveArch:	x86_64
 Source0:	https://github.com/GoogleCloudPlatform/kubernetes/archive/%{commit}/kubernetes-%{shortcommit}.tar.gz
 
-#config files
-Source10:	config
-Source11:	apiserver
-Source12:	controller-manager
-Source13:	proxy
-Source14:	kubelet
-Source15:	scheduler
-#service files
-Source20:	kube-apiserver.service
-Source21:	kube-controller-manager.service
-Source22:	kube-proxy.service
-Source23:	kubelet.service
-Source24:	kube-scheduler.service
+Source10:	kubectl
 
 Patch1:		0001-remove-all-third-party-software.patch
 
@@ -152,15 +140,16 @@ done
 
 # install the bash completion
 install -d -m 0755 %{buildroot}%{_datadir}/bash-completion/completions/
+install -t %{buildroot}%{_datadir}/bash-completion/completions/ %{SOURCE10}
 install -t %{buildroot}%{_datadir}/bash-completion/completions/ contrib/completions/bash/kubecfg
 
 # install config files
 install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}
-install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15}
+install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} contrib/init/systemd/environ/*
 
 # install service files
 install -d -m 0755 %{buildroot}%{_unitdir}
-install -m 0644 -t %{buildroot}%{_unitdir} %{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24}
+install -m 0644 -t %{buildroot}%{_unitdir} contrib/init/systemd/*.service
 
 # install manpages
 install -d %{buildroot}%{_mandir}/man1
@@ -185,6 +174,7 @@ install -d %{buildroot}/var/lib/kubelet
 %{_unitdir}/kube-proxy.service
 %dir %{_sysconfdir}/%{name}
 %{_datadir}/bash-completion/completions/kubecfg
+%{_datadir}/bash-completion/completions/kubectl
 %dir /var/lib/kubelet
 %config(noreplace) %{_sysconfdir}/%{name}/config
 %config(noreplace) %{_sysconfdir}/%{name}/apiserver
@@ -207,6 +197,11 @@ getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
 %systemd_postun
 
 %changelog
+* Mon Oct 20 2014 Eric Paris <eparis at redhat.com - 0.4-0.2.gitd5377e4
+- Bump to upstream d5377e4a394b4fc6e3088634729b538eac124b1b
+- Use in tree systemd unit and Environment files
+- Include kubectl bash completion from outside tree
+
 * Fri Oct 17 2014 Eric Paris <eparis at redhat.com - 0.4-0.1.gitb011263
 - Bump to upstream b01126322b826a15db06f6eeefeeb56dc06db7af
 - This is a major non backward compatible change.
diff --git a/proxy b/proxy
deleted file mode 100644
index 0342768..0000000
--- a/proxy
+++ /dev/null
@@ -1,7 +0,0 @@
-###
-# kubernetes proxy config
-
-# default config should be adequate
-
-# Add your own!
-KUBE_PROXY_ARGS=""
diff --git a/scheduler b/scheduler
deleted file mode 100644
index f6fc507..0000000
--- a/scheduler
+++ /dev/null
@@ -1,7 +0,0 @@
-###
-# kubernetes scheduler config
-
-# default config should be adequate
-
-# Add your own!
-KUBE_SCHEDULER_ARGS=""
diff --git a/sources b/sources
index 996d449..2ad5ecd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6dfac48ac66d5752dacdc8c24c37702d  kubernetes-b011263.tar.gz
+02e09314698d8ddf51932d70e173065a  kubernetes-d5377e4.tar.gz
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/kubernetes.git/commit/?h=f21&id=4596a2657837858753e60f1d01a3e92c14b29574


More information about the scm-commits mailing list