mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor files
This commit is contained in:
48
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/docker.sh
generated
vendored
Executable file
48
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/docker.sh
generated
vendored
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
DOCKER_OPTS=${1:-""}
|
||||
|
||||
DOCKER_CONFIG=/opt/kubernetes/cfg/docker
|
||||
|
||||
cat <<EOF >$DOCKER_CONFIG
|
||||
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock -s overlay --selinux-enabled=false ${DOCKER_OPTS}"
|
||||
EOF
|
||||
|
||||
cat <<EOF >/usr/lib/systemd/system/docker.service
|
||||
[Unit]
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.com
|
||||
After=network.target flannel.service
|
||||
Requires=flannel.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
EnvironmentFile=-/run/flannel/docker
|
||||
EnvironmentFile=-/opt/kubernetes/cfg/docker
|
||||
WorkingDirectory=/opt/kubernetes/bin
|
||||
ExecStart=/opt/kubernetes/bin/dockerd \$DOCKER_OPT_BIP \$DOCKER_OPT_MTU \$DOCKER_OPTS
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable docker
|
||||
systemctl restart docker
|
75
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/flannel.sh
generated
vendored
Executable file
75
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/flannel.sh
generated
vendored
Executable file
@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
ETCD_SERVERS=${1:-"https://8.8.8.18:2379"}
|
||||
FLANNEL_NET=${2:-"172.16.0.0/16"}
|
||||
|
||||
CA_FILE="/srv/kubernetes/etcd/ca.pem"
|
||||
CERT_FILE="/srv/kubernetes/etcd/client.pem"
|
||||
KEY_FILE="/srv/kubernetes/etcd/client-key.pem"
|
||||
|
||||
cat <<EOF >/opt/kubernetes/cfg/flannel
|
||||
FLANNEL_ETCD="-etcd-endpoints=${ETCD_SERVERS}"
|
||||
FLANNEL_ETCD_KEY="-etcd-prefix=/coreos.com/network"
|
||||
FLANNEL_ETCD_CAFILE="--etcd-cafile=${CA_FILE}"
|
||||
FLANNEL_ETCD_CERTFILE="--etcd-certfile=${CERT_FILE}"
|
||||
FLANNEL_ETCD_KEYFILE="--etcd-keyfile=${KEY_FILE}"
|
||||
EOF
|
||||
|
||||
cat <<EOF >/usr/lib/systemd/system/flannel.service
|
||||
[Unit]
|
||||
Description=Flanneld overlay address etcd agent
|
||||
After=network.target
|
||||
Before=docker.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/opt/kubernetes/cfg/flannel
|
||||
ExecStartPre=/opt/kubernetes/bin/remove-docker0.sh
|
||||
ExecStart=/opt/kubernetes/bin/flanneld --ip-masq \${FLANNEL_ETCD} \${FLANNEL_ETCD_KEY} \${FLANNEL_ETCD_CAFILE} \${FLANNEL_ETCD_CERTFILE} \${FLANNEL_ETCD_KEYFILE}
|
||||
ExecStartPost=/opt/kubernetes/bin/mk-docker-opts.sh -d /run/flannel/docker
|
||||
|
||||
Type=notify
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
RequiredBy=docker.service
|
||||
EOF
|
||||
|
||||
# Store FLANNEL_NET to etcd.
|
||||
attempt=0
|
||||
while true; do
|
||||
/opt/kubernetes/bin/etcdctl --ca-file ${CA_FILE} --cert-file ${CERT_FILE} --key-file ${KEY_FILE} \
|
||||
--no-sync -C ${ETCD_SERVERS} \
|
||||
get /coreos.com/network/config >/dev/null 2>&1
|
||||
if [[ "$?" == 0 ]]; then
|
||||
break
|
||||
else
|
||||
if (( attempt > 600 )); then
|
||||
echo "timeout for waiting network config" > ~/kube/err.log
|
||||
exit 2
|
||||
fi
|
||||
|
||||
/opt/kubernetes/bin/etcdctl --ca-file ${CA_FILE} --cert-file ${CERT_FILE} --key-file ${KEY_FILE} \
|
||||
--no-sync -C ${ETCD_SERVERS} \
|
||||
mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\"}" >/dev/null 2>&1
|
||||
attempt=$((attempt+1))
|
||||
sleep 3
|
||||
fi
|
||||
done
|
||||
wait
|
||||
|
||||
systemctl daemon-reload
|
97
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/kubelet.sh
generated
vendored
Executable file
97
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/kubelet.sh
generated
vendored
Executable file
@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
MASTER_ADDRESS=${1:-"8.8.8.18"}
|
||||
NODE_ADDRESS=${2:-"8.8.8.20"}
|
||||
DNS_SERVER_IP=${3:-"192.168.3.100"}
|
||||
DNS_DOMAIN=${4:-"cluster.local"}
|
||||
KUBECONFIG_DIR=${KUBECONFIG_DIR:-/opt/kubernetes/cfg}
|
||||
|
||||
# Generate a kubeconfig file
|
||||
cat <<EOF > "${KUBECONFIG_DIR}/kubelet.kubeconfig"
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- cluster:
|
||||
server: http://${MASTER_ADDRESS}:8080/
|
||||
name: local
|
||||
contexts:
|
||||
- context:
|
||||
cluster: local
|
||||
name: local
|
||||
current-context: local
|
||||
EOF
|
||||
|
||||
cat <<EOF >/opt/kubernetes/cfg/kubelet
|
||||
# --logtostderr=true: log to standard error instead of files
|
||||
KUBE_LOGTOSTDERR="--logtostderr=true"
|
||||
|
||||
# --v=0: log level for V logs
|
||||
KUBE_LOG_LEVEL="--v=4"
|
||||
|
||||
# --address=0.0.0.0: The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces)
|
||||
NODE_ADDRESS="--address=${NODE_ADDRESS}"
|
||||
|
||||
# --port=10250: The port for the Kubelet to serve on. Note that "kubectl logs" will not work if you set this flag.
|
||||
NODE_PORT="--port=10250"
|
||||
|
||||
# --hostname-override="": If non-empty, will use this string as identification instead of the actual hostname.
|
||||
NODE_HOSTNAME="--hostname-override=${NODE_ADDRESS}"
|
||||
|
||||
# Path to a kubeconfig file, specifying how to connect to the API server.
|
||||
KUBELET_KUBECONFIG="--kubeconfig=${KUBECONFIG_DIR}/kubelet.kubeconfig"
|
||||
|
||||
# --allow-privileged=false: If true, allow containers to request privileged mode. [default=false]
|
||||
KUBE_ALLOW_PRIV="--allow-privileged=false"
|
||||
|
||||
# DNS info
|
||||
KUBELET__DNS_IP="--cluster-dns=${DNS_SERVER_IP}"
|
||||
KUBELET_DNS_DOMAIN="--cluster-domain=${DNS_DOMAIN}"
|
||||
|
||||
# Add your own!
|
||||
KUBELET_ARGS=""
|
||||
EOF
|
||||
|
||||
KUBELET_OPTS=" \${KUBE_LOGTOSTDERR} \\
|
||||
\${KUBE_LOG_LEVEL} \\
|
||||
\${NODE_ADDRESS} \\
|
||||
\${NODE_PORT} \\
|
||||
\${NODE_HOSTNAME} \\
|
||||
\${KUBELET_KUBECONFIG} \\
|
||||
\${KUBE_ALLOW_PRIV} \\
|
||||
\${KUBELET__DNS_IP} \\
|
||||
\${KUBELET_DNS_DOMAIN} \\
|
||||
\$KUBELET_ARGS"
|
||||
|
||||
cat <<EOF >/usr/lib/systemd/system/kubelet.service
|
||||
[Unit]
|
||||
Description=Kubernetes Kubelet
|
||||
After=docker.service
|
||||
Requires=docker.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/opt/kubernetes/cfg/kubelet
|
||||
ExecStart=/opt/kubernetes/bin/kubelet ${KUBELET_OPTS}
|
||||
Restart=on-failure
|
||||
KillMode=process
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable kubelet
|
||||
systemctl restart kubelet
|
56
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/proxy.sh
generated
vendored
Executable file
56
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/proxy.sh
generated
vendored
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
MASTER_ADDRESS=${1:-"8.8.8.18"}
|
||||
NODE_ADDRESS=${2:-"8.8.8.20"}
|
||||
|
||||
cat <<EOF >/opt/kubernetes/cfg/kube-proxy
|
||||
# --logtostderr=true: log to standard error instead of files
|
||||
KUBE_LOGTOSTDERR="--logtostderr=true"
|
||||
|
||||
# --v=0: log level for V logs
|
||||
KUBE_LOG_LEVEL="--v=4"
|
||||
|
||||
# --hostname-override="": If non-empty, will use this string as identification instead of the actual hostname.
|
||||
NODE_HOSTNAME="--hostname-override=${NODE_ADDRESS}"
|
||||
|
||||
# --master="": The address of the Kubernetes API server (overrides any value in kubeconfig)
|
||||
KUBE_MASTER="--master=http://${MASTER_ADDRESS}:8080"
|
||||
EOF
|
||||
|
||||
KUBE_PROXY_OPTS=" \${KUBE_LOGTOSTDERR} \\
|
||||
\${KUBE_LOG_LEVEL} \\
|
||||
\${NODE_HOSTNAME} \\
|
||||
\${KUBE_MASTER}"
|
||||
|
||||
cat <<EOF >/usr/lib/systemd/system/kube-proxy.service
|
||||
[Unit]
|
||||
Description=Kubernetes Proxy
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/opt/kubernetes/cfg/kube-proxy
|
||||
ExecStart=/opt/kubernetes/bin/kube-proxy ${KUBE_PROXY_OPTS}
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable kube-proxy
|
||||
systemctl restart kube-proxy
|
Reference in New Issue
Block a user