mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
update k8s to 0.19.3
This commit is contained in:
parent
5540570e44
commit
69b55b82f8
@ -42,8 +42,10 @@ cp flannel-${FLANNEL_VERSION}/flanneld binaries/minion
|
|||||||
|
|
||||||
# ectd
|
# ectd
|
||||||
echo "Download etcd release ..."
|
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"
|
ETCD="etcd-v${ETCD_VERSION}-linux-amd64"
|
||||||
|
|
||||||
if [ ! -f etcd.tar.gz ] ; then
|
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
|
curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${ETCD}.tar.gz -o etcd.tar.gz
|
||||||
tar xzf etcd.tar.gz
|
tar xzf etcd.tar.gz
|
||||||
@ -53,7 +55,8 @@ cp $ETCD/etcd $ETCD/etcdctl binaries/minion
|
|||||||
|
|
||||||
# k8s
|
# k8s
|
||||||
echo "Download kubernetes release ..."
|
echo "Download kubernetes release ..."
|
||||||
K8S_VERSION=${K8S_VERSION:-"0.18.0"}
|
K8S_VERSION=${K8S_VERSION:-"0.19.3"}
|
||||||
|
|
||||||
if [ ! -f kubernetes.tar.gz ] ; then
|
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
|
curl -L https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v${K8S_VERSION}/kubernetes.tar.gz -o kubernetes.tar.gz
|
||||||
tar xzf 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/
|
cp kubernetes/server/kubernetes/server/bin/kubectl binaries/
|
||||||
|
|
||||||
rm -rf flannel* kubernetes* etcd*
|
rm -rf flannel* kubernetes* etcd*
|
||||||
|
|
||||||
echo "Done! All your commands locate in ./binaries dir"
|
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}
|
export FLANNEL_OPTS=${FLANNEL_OPTS:-"Network": 172.16.0.0/16}
|
||||||
|
|
||||||
# Admission Controllers to invoke prior to persisting objects in cluster
|
# 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.
|
# Optional: Enable node logging.
|
||||||
ENABLE_NODE_LOGGING=false
|
ENABLE_NODE_LOGGING=false
|
||||||
|
@ -183,6 +183,16 @@ function verify-minion(){
|
|||||||
printf "\n"
|
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(){
|
function create-etcd-opts(){
|
||||||
cat <<EOF > ~/kube/default/etcd
|
cat <<EOF > ~/kube/default/etcd
|
||||||
ETCD_OPTS="-name $1 \
|
ETCD_OPTS="-name $1 \
|
||||||
@ -200,13 +210,17 @@ KUBE_APISERVER_OPTS="--address=0.0.0.0 \
|
|||||||
--port=8080 \
|
--port=8080 \
|
||||||
--etcd_servers=http://127.0.0.1:4001 \
|
--etcd_servers=http://127.0.0.1:4001 \
|
||||||
--logtostderr=true \
|
--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
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function create-kube-controller-manager-opts(){
|
function create-kube-controller-manager-opts(){
|
||||||
cat <<EOF > ~/kube/default/kube-controller-manager
|
cat <<EOF > ~/kube/default/kube-controller-manager
|
||||||
KUBE_CONTROLLER_MANAGER_OPTS="--master=127.0.0.1:8080 \
|
KUBE_CONTROLLER_MANAGER_OPTS="--master=127.0.0.1:8080 \
|
||||||
|
--service_account_private_key_file=/tmp/kube-serviceaccount.key \
|
||||||
--logtostderr=true"
|
--logtostderr=true"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -307,7 +321,7 @@ function detect-minions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Instantiate a kubernetes cluster on ubuntu
|
# Instantiate a kubernetes cluster on ubuntu
|
||||||
function kube-up {
|
function kube-up() {
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||||
source "${KUBE_ROOT}/cluster/ubuntu/${KUBE_CONFIG_FILE-"config-default.sh"}"
|
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
|
# remote login to MASTER and use sudo to configue k8s master
|
||||||
ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
|
ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
|
||||||
|
genServiceAccountsKey; \
|
||||||
setClusterInfo; \
|
setClusterInfo; \
|
||||||
create-etcd-opts "${mm[${MASTER_IP}]}" "${MASTER_IP}" "${CLUSTER}"; \
|
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-controller-manager-opts "${MINION_IPS}"; \
|
||||||
create-kube-scheduler-opts; \
|
create-kube-scheduler-opts; \
|
||||||
create-flanneld-opts; \
|
create-flanneld-opts; \
|
||||||
@ -402,8 +417,9 @@ function provision-masterandminion() {
|
|||||||
# remote login to the node and use sudo to configue k8s
|
# remote login to the node and use sudo to configue k8s
|
||||||
ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
|
ssh $SSH_OPTS -t $MASTER "source ~/kube/util.sh; \
|
||||||
setClusterInfo; \
|
setClusterInfo; \
|
||||||
|
genServiceAccountsKey; \
|
||||||
create-etcd-opts "${mm[${MASTER_IP}]}" "${MASTER_IP}" "${CLUSTER}"; \
|
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-controller-manager-opts "${MINION_IPS}"; \
|
||||||
create-kube-scheduler-opts; \
|
create-kube-scheduler-opts; \
|
||||||
create-kubelet-opts "${MASTER_IP}" "${MASTER_IP}" "${DNS_SERVER_IP}" "${DNS_DOMAIN}";
|
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
|
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
|
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 |
|
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) |
|
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) |
|
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) |
|
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*
|
*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*
|
*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`.
|
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.
|
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.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user