From c3b9405fbf6d001077786fb55c77cf9c5cd60ef8 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Mon, 29 Feb 2016 11:06:16 +0100 Subject: [PATCH 1/2] New package: etcd-2.2.5 --- srcpkgs/etcd/files/etcd/conf | 249 +++++++++++++++++++++++++++++++++++ srcpkgs/etcd/files/etcd/run | 7 + srcpkgs/etcd/template | 24 ++++ 3 files changed, 280 insertions(+) create mode 100644 srcpkgs/etcd/files/etcd/conf create mode 100644 srcpkgs/etcd/files/etcd/run create mode 100644 srcpkgs/etcd/template diff --git a/srcpkgs/etcd/files/etcd/conf b/srcpkgs/etcd/files/etcd/conf new file mode 100644 index 00000000000..023129b0e07 --- /dev/null +++ b/srcpkgs/etcd/files/etcd/conf @@ -0,0 +1,249 @@ +# Human_readable name for this member. +# +# default: "default" +# +# ETCD_NAME="default" + +# Path to the data directory. +# +# default: "${name}.etcd" +# distribution default: "/var/lib/etcd" +# +# ETCD_DATA_DIR="/var/lib/etcd" + +# Path to the dedicated wal directory. +# If this flag is set, etcd will write the WAL files +# to the walDir rather than the dataDir. +# +# default: "" +# +# ETCD_WAL_DIR="" + +# Number of committed transactions to trigger a snapshot to disk. +# +# default: 10000 +# +# ETCD_SNAPSHOT_COUNT=10000 + +# Time (in milliseconds) of a heartbeat interval. +# +# default: 100 +# +# ETCD_HEARTBEAT_INTERVAL=100 + +# Time (in milliseconds) for an election to timeout. +# +# default: 1000 +# +# ETCD_ELECTION_TIMEOUT=1000 + +# List of URLs to listen on for peer traffic. +# +# default: "http://localhost:2380,http://localhost:7001" +# +# ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001" + +# List of URLs to listen on for client traffic. +# +# default: "http://localhost:2379,http://localhost:4001" +# +# ETCD_LISTEN_CLIENT_URLS="http://localhost:2379,http://localhost:4001" + +# Maximum number of snapshot files to retain (0 is unlimited) +# +# default: 5 +# +# ETCD_MAX_SNAPSHOTS=5 + +# Maximum number of wal files to retain (0 is unlimited) +# +# default: 5 +# +# ETCD_MAX_WALS=5 + +# Comma_separated white list of origins for CORS (cross_origin resource sharing). +# +# default: none +# +# ETCD_CORS= + +# List of this member's peer URLs to advertise to the rest of the cluster. +# These addresses are used for communicating etcd data around the cluster. +# At least one must be routable to all cluster members. +# +# default: "http://localhost:2380,http://localhost:7001" +# +# ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380,http://localhost:7001" + +# Initial cluster configuration for bootstrapping. +# +# default: "default=http://localhost:2380,default=http://localhost:7001" +# distribution default: "default=http://localhost:2380,default=http://localhost:7001" +# +# ETCD_INITIAL_CLUSTER="default=http://localhost:2380,default=http://localhost:7001" + +# Initial cluster state ("new" or "existing"). +# Set to new for all members present during initial static or DNS bootstrapping. +# If this option is set to existing, etcd will attempt to join the existing cluster. +# If the wrong value is set, etcd will attempt to start but fail safely. +# +# default: "new" +# +# ETCD_INITIAL_CLUSTER_STATE="new" + +# Initial cluster token for the etcd cluster during bootstrap. +# +# default: "etcd_cluster" +# +# ETCD_INITIAL_CLUSTER_TOKEN="etcd_cluster" + +# List of this member's client URLs to advertise to the rest of the cluster. +# +# default: "http://localhost:2379,http://localhost:4001" +# +# ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" + +# Discovery URL used to bootstrap the cluster. +# +# default: none +# +# ETCD_DISCOVERY= + +# DNS srv domain used to bootstrap the cluster. +# +# default: none +# +# ETCD_DISCOVERY_SRV= + +# Expected behavior ("exit" or "proxy") when discovery services fails. +# +# default: "proxy" +# +# ETCD_DISCOVERY_FALLBACK="proxy" + +# HTTP proxy to use for traffic to discovery service. +# +# default: none +# +# ETCD_DISCOVERY_PROXY= + +# Proxy mode setting ("off", "readonly" or "on"). +# +# default: "off" +# +# ETCD_PROXY="off" + +# Time (in milliseconds) an endpoint will be held +# in a failed state before being reconsidered for proxied requests. +# +# default: 5000 +# +# ETCD_PROXY_FAILURE_WAIT=5000 + +# Time (in milliseconds) of the endpoints refresh interval. +# +# default: 30000 +# +# ETCD_PROXY_REFRESH_INTERVAL=30000 + +# Time (in milliseconds) for a dial to timeout or 0 to disable the timeout. +# +# default: 1000 +# +# ETCD_PROXY_DIAL_TIMEOUT=1000 + +# Time (in milliseconds) for a write to timeout or 0 to disable the timeout. +# +# default: 5000 +# +# ETCD_PROXY_WRITE_TIMEOUT=5000 + +# Time (in milliseconds) for a read to timeout or 0 to disable the timeout. +# Don't change this value if you use watches because they are using long polling requests. +# +# default: 0 +# +# ETCD_PROXY_READ_TIMEOUT=0 + +# Path to the client server TLS CA file. +# +# default: none +# +# ETCD_CA_FILE= + +# Path to the client server TLS cert file. +# +# default: none +# +# ETCD_CERT_FILE= + +# Path to the client server TLS key file. +# +# default: none +# +# ETCD_KEY_FILE= + +# Enable client cert authentication. +# +# default: false +# +# ETCD_CLIENT_CERT_AUTH=false + +# Path to the client server TLS trusted CA key file. +# +# default: none +# +# ETCD_TRUSTED_CA_FILE= + +# [DEPRECATED] Path to the peer server TLS CA file. +# +# default: none +# +# ETCD_PEER_CA_FILE= + +# Path to the peer server TLS cert file. +# +# default: none +# +# ETCD_PEER_CERT_FILE= + +# Path to the peer server TLS key file. +# +# default: none +# +# ETCD_PEER_KEY_FILE= + +# Enable peer client cert authentication. +# +# default: false +# +# ETCD_PEER_CLIENT_CERT_AUTH=false + +# Path to the peer server TLS trusted CA file. +# +# default: none +# +# ETCD_PEER_TRUSTED_CA_FILE= + +# Drop the default log level to DEBUG for all subpackages. +# +# default: false (INFO for all packages) +# +# ETCD_DEBUG=false + +# Set individual etcd subpackages to specific log levels. +# An example being etcdserver=WARNING,security=DEBUG +# +# default: none (INFO for all packages) +# +# ETCD_LOG_PACKAGE_LEVELS= + +# Force to create a new one_member cluster. +# It commits configuration changes in force to remove all existing members in the cluster and add itself. +# It needs to be set to restore a backup. +# +# default: false +# +# ETCD_FORCE_NEW_CLUSTER=false + +# vim:ft=sh: diff --git a/srcpkgs/etcd/files/etcd/run b/srcpkgs/etcd/files/etcd/run new file mode 100644 index 00000000000..4d3f3656299 --- /dev/null +++ b/srcpkgs/etcd/files/etcd/run @@ -0,0 +1,7 @@ +#!/bin/sh + +export ETCD_DATA_DIR=/var/lib/etcd +export ETCD_NAME=etcd + +[ -r conf ] && . ./conf +exec chpst -u etcd:etcd etcd diff --git a/srcpkgs/etcd/template b/srcpkgs/etcd/template new file mode 100644 index 00000000000..908bb907668 --- /dev/null +++ b/srcpkgs/etcd/template @@ -0,0 +1,24 @@ +# Template file for 'etcd' +pkgname=etcd +version=2.2.5 +revision=1 +build_style=go +short_desc="Distributed reliable key-value store" +maintainer="Andrea Brancaleoni " +license="Apache-2.0" +go_import_path="github.com/coreos/etcd" +homepage="https://coreos.com/etcd/docs/latest/" +distfiles="https://${go_import_path}/archive/v${version}.tar.gz" +checksum=a7fb7998ada620fda74e517c100891d25a15a6fa20b627df52da7cd29328e6d5 +conf_files="/etc/sv/etcd/conf" +system_accounts="etcd" +make_dirs="/var/lib/etcd 0755 etcd etcd" + +post_build() { + go get -x ${go_import_path}/etcdctl +} + +post_install() { + vlicense LICENSE + vsv etcd +} From 1233b6f227e9653a71711858b6668069f1bfef52 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Mon, 29 Feb 2016 17:52:57 +0100 Subject: [PATCH 2/2] New package: kubernetes-1.1.8 --- srcpkgs/kubernetes/files/environ/apiserver | 26 +++++++++++ srcpkgs/kubernetes/files/environ/config | 22 +++++++++ .../files/environ/controller-manager | 7 +++ srcpkgs/kubernetes/files/environ/kubelet | 17 +++++++ srcpkgs/kubernetes/files/environ/proxy | 7 +++ srcpkgs/kubernetes/files/environ/scheduler | 7 +++ srcpkgs/kubernetes/files/kube-apiserver/run | 14 ++++++ .../files/kube-controller-manager/run | 8 ++++ srcpkgs/kubernetes/files/kube-proxy/run | 8 ++++ srcpkgs/kubernetes/files/kube-scheduler/run | 8 ++++ srcpkgs/kubernetes/files/kubelet/run | 4 ++ srcpkgs/kubernetes/template | 46 +++++++++++++++++++ 12 files changed, 174 insertions(+) create mode 100644 srcpkgs/kubernetes/files/environ/apiserver create mode 100644 srcpkgs/kubernetes/files/environ/config create mode 100644 srcpkgs/kubernetes/files/environ/controller-manager create mode 100644 srcpkgs/kubernetes/files/environ/kubelet create mode 100644 srcpkgs/kubernetes/files/environ/proxy create mode 100644 srcpkgs/kubernetes/files/environ/scheduler create mode 100644 srcpkgs/kubernetes/files/kube-apiserver/run create mode 100644 srcpkgs/kubernetes/files/kube-controller-manager/run create mode 100644 srcpkgs/kubernetes/files/kube-proxy/run create mode 100644 srcpkgs/kubernetes/files/kube-scheduler/run create mode 100644 srcpkgs/kubernetes/files/kubelet/run create mode 100644 srcpkgs/kubernetes/template diff --git a/srcpkgs/kubernetes/files/environ/apiserver b/srcpkgs/kubernetes/files/environ/apiserver new file mode 100644 index 00000000000..223b99203c7 --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/apiserver @@ -0,0 +1,26 @@ +### +# kubernetes system config +# +# The following values are used to configure the kube-apiserver +# + +# The address on the local server to listen to. +KUBE_API_ADDRESS="--insecure-bind-address=127.0.0.1" + +# The port on the local server to listen on. +# KUBE_API_PORT="--port=8080" + +# Port minions listen on +# KUBELET_PORT="--kubelet-port=10250" + +# Comma separated list of nodes in the etcd cluster +KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:4001" + +# Address range to use for services +KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" + +# default admission control policies +KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota" + +# Add your own! +KUBE_API_ARGS="" diff --git a/srcpkgs/kubernetes/files/environ/config b/srcpkgs/kubernetes/files/environ/config new file mode 100644 index 00000000000..8c0a28493fd --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/config @@ -0,0 +1,22 @@ +### +# kubernetes system config +# +# The following values are used to configure various aspects of all +# kubernetes services, including +# +# kube-apiserver.service +# kube-controller-manager.service +# kube-scheduler.service +# kubelet.service +# kube-proxy.service +# 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 privileged docker containers +KUBE_ALLOW_PRIV="--allow-privileged=false" + +# How the controller-manager, scheduler, and proxy find the apiserver +KUBE_MASTER="--master=http://127.0.0.1:8080" diff --git a/srcpkgs/kubernetes/files/environ/controller-manager b/srcpkgs/kubernetes/files/environ/controller-manager new file mode 100644 index 00000000000..1a9e3f204c9 --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/controller-manager @@ -0,0 +1,7 @@ +### +# The following values are used to configure the kubernetes controller-manager + +# defaults from config and apiserver should be adequate + +# Add your own! +KUBE_CONTROLLER_MANAGER_ARGS="" diff --git a/srcpkgs/kubernetes/files/environ/kubelet b/srcpkgs/kubernetes/files/environ/kubelet new file mode 100644 index 00000000000..db93a5eeb42 --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/kubelet @@ -0,0 +1,17 @@ +### +# kubernetes kubelet (minion) config + +# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces) +KUBELET_ADDRESS="--address=127.0.0.1" + +# The port for the info server to serve on +# KUBELET_PORT="--port=10250" + +# You may leave this blank to use the actual hostname +KUBELET_HOSTNAME="--hostname-override=127.0.0.1" + +# location of the api-server +KUBELET_API_SERVER="--api-servers=http://127.0.0.1:8080" + +# Add your own! +KUBELET_ARGS="" diff --git a/srcpkgs/kubernetes/files/environ/proxy b/srcpkgs/kubernetes/files/environ/proxy new file mode 100644 index 00000000000..034276831ba --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/proxy @@ -0,0 +1,7 @@ +### +# kubernetes proxy config + +# default config should be adequate + +# Add your own! +KUBE_PROXY_ARGS="" diff --git a/srcpkgs/kubernetes/files/environ/scheduler b/srcpkgs/kubernetes/files/environ/scheduler new file mode 100644 index 00000000000..f6fc507b72c --- /dev/null +++ b/srcpkgs/kubernetes/files/environ/scheduler @@ -0,0 +1,7 @@ +### +# kubernetes scheduler config + +# default config should be adequate + +# Add your own! +KUBE_SCHEDULER_ARGS="" diff --git a/srcpkgs/kubernetes/files/kube-apiserver/run b/srcpkgs/kubernetes/files/kube-apiserver/run new file mode 100644 index 00000000000..159804b95a5 --- /dev/null +++ b/srcpkgs/kubernetes/files/kube-apiserver/run @@ -0,0 +1,14 @@ +#!/bin/sh +[ -r /etc/kubernetes/config ] && . /etc/kubernetes/config +[ -r /etc/kubernetes/apiserver ] && . /etc/kubernetes/apiserver +exec chpst -u kube:kube kube-apiserver \ + $KUBE_LOGTOSTDERR \ + $KUBE_LOG_LEVEL \ + $KUBE_ETCD_SERVERS \ + $KUBE_API_ADDRESS \ + $KUBE_API_PORT \ + $KUBELET_PORT \ + $KUBE_ALLOW_PRIV \ + $KUBE_SERVICE_ADDRESSES \ + $KUBE_ADMISSION_CONTROL \ + $KUBE_API_ARGS 2>/dev/null diff --git a/srcpkgs/kubernetes/files/kube-controller-manager/run b/srcpkgs/kubernetes/files/kube-controller-manager/run new file mode 100644 index 00000000000..5d298168109 --- /dev/null +++ b/srcpkgs/kubernetes/files/kube-controller-manager/run @@ -0,0 +1,8 @@ +#!/bin/sh +[ -r /etc/kubernetes/config ] && . /etc/kubernetes/config +[ -r /etc/kubernetes/controller-manager ] && . /etc/kubernetes/controller-manager +exec chpst -u kube:kube kube-controller-manager \ + $KUBE_LOGTOSTDERR \ + $KUBE_LOG_LEVEL \ + $KUBE_MASTER \ + $KUBE_CONTROLLER_MANAGER_ARGS 2>/dev/null diff --git a/srcpkgs/kubernetes/files/kube-proxy/run b/srcpkgs/kubernetes/files/kube-proxy/run new file mode 100644 index 00000000000..58f4865ccbe --- /dev/null +++ b/srcpkgs/kubernetes/files/kube-proxy/run @@ -0,0 +1,8 @@ +#!/bin/sh +[ -r /etc/kubernetes/config ] && . /etc/kubernetes/config +[ -r /etc/kubernetes/proxy ] && . /etc/kubernetes/proxy +exec kube-proxy \ + $KUBE_LOGTOSTDERR \ + $KUBE_LOG_LEVEL \ + $KUBE_MASTER \ + $KUBE_PROXY_ARGS 2>/dev/null diff --git a/srcpkgs/kubernetes/files/kube-scheduler/run b/srcpkgs/kubernetes/files/kube-scheduler/run new file mode 100644 index 00000000000..8e0a83a7613 --- /dev/null +++ b/srcpkgs/kubernetes/files/kube-scheduler/run @@ -0,0 +1,8 @@ +#!/bin/sh +[ -r /etc/kubernetes/config ] && . /etc/kubernetes/config +[ -r /etc/kubernetes/scheduler ] && . /etc/kubernetes/scheduler +exec chpst -u kube:kube kube-scheduler \ + $KUBE_LOGTOSTDERR \ + $KUBE_LOG_LEVEL \ + $KUBE_MASTER \ + $KUBE_SCHEDULER_ARGS 2>/dev/null diff --git a/srcpkgs/kubernetes/files/kubelet/run b/srcpkgs/kubernetes/files/kubelet/run new file mode 100644 index 00000000000..4b623e966e5 --- /dev/null +++ b/srcpkgs/kubernetes/files/kubelet/run @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r /etc/kubernetes/config ] && . /etc/kubernetes/config +[ -r /etc/kubernetes/kubelet ] && . /etc/kubernetes/kubelet +exec kubelet $OPTS 2>/dev/null diff --git a/srcpkgs/kubernetes/template b/srcpkgs/kubernetes/template new file mode 100644 index 00000000000..10e8a3c8a5a --- /dev/null +++ b/srcpkgs/kubernetes/template @@ -0,0 +1,46 @@ +# Template file for 'kubernetes' +pkgname=kubernetes +version=1.1.8 +revision=1 +build_style=go +nocross=yes +only_for_archs="x86_64 x86_64-musl" +hostmakedepends="rsync git git-perl" +short_desc="Container Cluster Manager for Docker" +maintainer="Andrea Brancaleoni " +license="Apache-2.0" +go_import_path="github.com/kubernetes/kubernetes" +homepage="http://kubernetes.io" +distfiles="https://$go_import_path/archive/v$version.tar.gz" +checksum=fbc1a01edc6683dc3c59830a63622730c5baece1e02dfa1cd32a852bf4415581 +system_accounts="kube" +make_dirs="/var/lib/kubelet 0755 kube kube" +conf_files="/etc/kubernetes/*" + +do_build() { + ./hack/build-go.sh +} + +do_install() { + find "_output/local/bin/linux/" -type f -executable | grep "kube" | egrep -v "gen|test" | while read line + do + vbin "${line}" + done + + for MAN in docs/man/man1/*.1; do + vman ${MAN} + done + + vinstall contrib/completions/bash/kubectl 644 usr/share/bash-completion/completions + + vmkdir etc/kubernetes + vcopy ${FILESDIR}/environ/* etc/kubernetes + + vsv kube-apiserver + vsv kube-controller-manager + vsv kubelet + vsv kube-scheduler + vsv kube-proxy + + vlicense LICENSE +}