mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	update k8s to 0.19.3
This commit is contained in:
		@@ -42,8 +42,10 @@ cp flannel-${FLANNEL_VERSION}/flanneld binaries/minion
 | 
			
		||||
 | 
			
		||||
# ectd
 | 
			
		||||
echo "Download etcd release ..."
 | 
			
		||||
ETCD_VERSION=${ETCD_VERSION:-"2.0.9"}
 | 
			
		||||
 | 
			
		||||
ETCD_VERSION=${ETCD_VERSION:-"2.0.12"}
 | 
			
		||||
ETCD="etcd-v${ETCD_VERSION}-linux-amd64"
 | 
			
		||||
 | 
			
		||||
if [ ! -f etcd.tar.gz ] ; then
 | 
			
		||||
  curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${ETCD}.tar.gz -o etcd.tar.gz
 | 
			
		||||
  tar xzf etcd.tar.gz
 | 
			
		||||
@@ -53,7 +55,8 @@ cp $ETCD/etcd $ETCD/etcdctl binaries/minion
 | 
			
		||||
 | 
			
		||||
# k8s
 | 
			
		||||
echo "Download kubernetes release ..."
 | 
			
		||||
K8S_VERSION=${K8S_VERSION:-"0.18.0"}
 | 
			
		||||
K8S_VERSION=${K8S_VERSION:-"0.19.3"}
 | 
			
		||||
 | 
			
		||||
if [ ! -f kubernetes.tar.gz ] ; then
 | 
			
		||||
  curl -L https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v${K8S_VERSION}/kubernetes.tar.gz -o kubernetes.tar.gz
 | 
			
		||||
  tar xzf kubernetes.tar.gz
 | 
			
		||||
@@ -71,4 +74,5 @@ cp kubernetes/server/kubernetes/server/bin/kubelet \
 | 
			
		||||
cp kubernetes/server/kubernetes/server/bin/kubectl binaries/
 | 
			
		||||
 | 
			
		||||
rm -rf flannel* kubernetes* etcd*
 | 
			
		||||
 | 
			
		||||
echo "Done! All your commands locate in ./binaries dir"
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@ echo $FLANNEL_NET
 | 
			
		||||
export FLANNEL_OPTS=${FLANNEL_OPTS:-"Network": 172.16.0.0/16}
 | 
			
		||||
 | 
			
		||||
# Admission Controllers to invoke prior to persisting objects in cluster
 | 
			
		||||
ADMISSION_CONTROL=${ADMISSION_CONTROL:-NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ServiceAccount,ResourceQuota}
 | 
			
		||||
export ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ServiceAccount,ResourceQuota
 | 
			
		||||
 | 
			
		||||
# Optional: Enable node logging.
 | 
			
		||||
ENABLE_NODE_LOGGING=false
 | 
			
		||||
 
 | 
			
		||||
@@ -183,6 +183,16 @@ function verify-minion(){
 | 
			
		||||
  printf "\n"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function genServiceAccountsKey() {
 | 
			
		||||
    SERVICE_ACCOUNT_LOOKUP=${SERVICE_ACCOUNT_LOOKUP:-false}
 | 
			
		||||
    SERVICE_ACCOUNT_KEY=${SERVICE_ACCOUNT_KEY:-"/tmp/kube-serviceaccount.key"}
 | 
			
		||||
    # Generate ServiceAccount key if needed
 | 
			
		||||
    if [[ ! -f "${SERVICE_ACCOUNT_KEY}" ]]; then
 | 
			
		||||
      mkdir -p "$(dirname ${SERVICE_ACCOUNT_KEY})"
 | 
			
		||||
      openssl genrsa -out "${SERVICE_ACCOUNT_KEY}" 2048 2>/dev/null
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function create-etcd-opts(){
 | 
			
		||||
  cat <<EOF > ~/kube/default/etcd
 | 
			
		||||
ETCD_OPTS="-name $1 \
 | 
			
		||||
@@ -200,13 +210,17 @@ KUBE_APISERVER_OPTS="--address=0.0.0.0 \
 | 
			
		||||
--port=8080 \
 | 
			
		||||
--etcd_servers=http://127.0.0.1:4001 \
 | 
			
		||||
--logtostderr=true \
 | 
			
		||||
--service-cluster-ip-range=${1}"
 | 
			
		||||
--service-cluster-ip-range=${1} \
 | 
			
		||||
--admission_control=${2} \
 | 
			
		||||
--service_account_key_file=/tmp/kube-serviceaccount.key \
 | 
			
		||||
--service_account_lookup=false "
 | 
			
		||||
EOF
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function create-kube-controller-manager-opts(){
 | 
			
		||||
  cat <<EOF > ~/kube/default/kube-controller-manager
 | 
			
		||||
KUBE_CONTROLLER_MANAGER_OPTS="--master=127.0.0.1:8080 \
 | 
			
		||||
--service_account_private_key_file=/tmp/kube-serviceaccount.key \
 | 
			
		||||
--logtostderr=true"
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
@@ -307,7 +321,7 @@ function detect-minions {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Instantiate a kubernetes cluster on ubuntu
 | 
			
		||||
function kube-up {
 | 
			
		||||
function kube-up() {
 | 
			
		||||
  KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
 | 
			
		||||
  source "${KUBE_ROOT}/cluster/ubuntu/${KUBE_CONFIG_FILE-"config-default.sh"}"
 | 
			
		||||
 | 
			
		||||
@@ -361,9 +375,10 @@ function provision-master() {
 | 
			
		||||
 | 
			
		||||
  # remote login to MASTER and use sudo to configue k8s master
 | 
			
		||||
  ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
 | 
			
		||||
                            genServiceAccountsKey; \
 | 
			
		||||
                            setClusterInfo; \
 | 
			
		||||
                            create-etcd-opts "${mm[${MASTER_IP}]}" "${MASTER_IP}" "${CLUSTER}"; \
 | 
			
		||||
                            create-kube-apiserver-opts "${SERVICE_CLUSTER_IP_RANGE}"; \
 | 
			
		||||
                            create-kube-apiserver-opts "${SERVICE_CLUSTER_IP_RANGE}" "${ADMISSION_CONTROL}"; \
 | 
			
		||||
                            create-kube-controller-manager-opts "${MINION_IPS}"; \
 | 
			
		||||
                            create-kube-scheduler-opts; \
 | 
			
		||||
                            create-flanneld-opts; \
 | 
			
		||||
@@ -402,8 +417,9 @@ function provision-masterandminion() {
 | 
			
		||||
  # remote login to the node and use sudo to configue k8s
 | 
			
		||||
  ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
 | 
			
		||||
                            setClusterInfo; \
 | 
			
		||||
                            genServiceAccountsKey; \
 | 
			
		||||
                            create-etcd-opts "${mm[${MASTER_IP}]}" "${MASTER_IP}" "${CLUSTER}"; \
 | 
			
		||||
                            create-kube-apiserver-opts "${SERVICE_CLUSTER_IP_RANGE}"; \
 | 
			
		||||
                            create-kube-apiserver-opts "${SERVICE_CLUSTER_IP_RANGE}" "${ADMISSION_CONTROL}"; \
 | 
			
		||||
                            create-kube-controller-manager-opts "${MINION_IPS}"; \
 | 
			
		||||
                            create-kube-scheduler-opts; \
 | 
			
		||||
                            create-kubelet-opts "${MASTER_IP}" "${MASTER_IP}" "${DNS_SERVER_IP}" "${DNS_DOMAIN}";
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ Joyent               | Juju         | Ubuntu | flannel     | [docs](../../docs/g
 | 
			
		||||
AWS                  | Saltstack    | Ubuntu | OVS         | [docs](../../docs/getting-started-guides/aws.md)                               |             | Community (@justinsb)        | Uses K8s version 0.5.0
 | 
			
		||||
Vmware               | CoreOS       | CoreOS | flannel     | [docs](../../docs/getting-started-guides/coreos.md)                            |             | Community (@kelseyhightower) | Uses K8s version 0.15.0
 | 
			
		||||
Azure                | Saltstack    | Ubuntu | OpenVPN     | [docs](../../docs/getting-started-guides/azure.md)                             |             | Community                    |
 | 
			
		||||
Bare-metal           | custom       | Ubuntu | flannel     | [docs](../../docs/getting-started-guides/ubuntu.md)                            |             | Community (@resouer @WIZARD-CXY)       | use k8s version 0.18.0
 | 
			
		||||
Bare-metal           | custom       | Ubuntu | flannel     | [docs](../../docs/getting-started-guides/ubuntu.md)                            |             | Community (@resouer @WIZARD-CXY)       | use k8s version 0.19.3
 | 
			
		||||
Local                |              |        | _none_      | [docs](../../docs/getting-started-guides/locally.md)                           |             | Community (@preillyme)      |
 | 
			
		||||
libvirt/KVM          | CoreOS       | CoreOS | libvirt/KVM | [docs](../../docs/getting-started-guides/libvirt-coreos.md)                    |             | Community (@lhuard1A)       |
 | 
			
		||||
oVirt                |              |        |             | [docs](../../docs/getting-started-guides/ovirt.md)                             |             | Community (@simon3z)        |
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ This document describes how to deploy kubernetes on ubuntu nodes, including 1 ma
 | 
			
		||||
 | 
			
		||||
*3 These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it should also work on most Ubuntu versions*
 | 
			
		||||
 | 
			
		||||
*4 Dependences of this guide: etcd-2.0.9, flannel-0.4.0, k8s-0.18.0, but it may work with higher versions*
 | 
			
		||||
*4 Dependences of this guide: etcd-2.0.12, flannel-0.4.0, k8s-0.19.3, but it may work with higher versions*
 | 
			
		||||
 | 
			
		||||
*5 All the remote servers can be ssh logged in without a password by using key authentication* 
 | 
			
		||||
 | 
			
		||||
@@ -35,7 +35,7 @@ then `$ cd kubernetes/cluster/ubuntu`.
 | 
			
		||||
 | 
			
		||||
Then run `$ ./build.sh`, this will download all the needed binaries into `./binaries`.
 | 
			
		||||
 | 
			
		||||
You can customize your etcd version, flannel version, k8s version by changing variable `ETCD_VERSION` , `FLANNEL_VERSION` and `K8S_VERSION` in build.sh, default etcd version is 2.0.9, flannel version is 0.4.0 and K8s version is 0.18.0.
 | 
			
		||||
You can customize your etcd version, flannel version, k8s version by changing variable `ETCD_VERSION` , `FLANNEL_VERSION` and `K8S_VERSION` in build.sh, default etcd version is 2.0.12, flannel version is 0.4.0 and K8s version is 0.19.3.
 | 
			
		||||
 | 
			
		||||
Please make sure that there are `kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, `kubelet`, `kube-proxy`, `etcd`, `etcdctl` and `flannel` in the binaries/master or binaries/minion directory.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user