1554 ls
1555 docker-compose down && docker-compose up -d
1557 apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
1558 python
1559 apt-get install python2.7 git python-pip
1560 ln -s /usr/bin/python2.7 /usr/bin/python
1561 pip install pip --upgrade -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
1562 cat <1563 # 系统安装源
1564 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
1565 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
1566 deb http://mirrors.aliyun.com/ubuntu/ xenial universe
1567 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
1568 deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
1569 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
1570 deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
1571 # kubeadm及kubernetes组件安装源
1572 deb https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial main
1573 EOF
1574 cat /etc/apt/sources.list
1575 apt-get update -y && apt-get install -y kubelet kubeadm kubectl --allow-unauthenticated
1576 swapoff -a
1577 docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.13.2
1578 docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.13.2
1579 docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.13.2
1580 docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.13.2
1581 docker pull mirrorgooglecontainers/pause:3.1
1582 docker pull mirrorgooglecontainers/etcd-amd64:3.2.24
1583 docker pull coredns/coredns:1.2.6
1584 docker tag docker.io/mirrorgooglecontainers/kube-proxy-amd64:v1.13.2 k8s.gcr.io/kube-proxy:v1.13.2
1585 docker tag docker.io/mirrorgooglecontainers/kube-scheduler-amd64:v1.13.2 k8s.gcr.io/kube-scheduler:v1.13.2
1586 docker tag docker.io/mirrorgooglecontainers/kube-apiserver-amd64:v1.13.2 k8s.gcr.io/kube-apiserver:v1.13.2
1587 docker tag docker.io/mirrorgooglecontainers/kube-controller-manager-amd64:v1.13.2 k8s.gcr.io/kube-controller-manager:v1.13.2
1588 docker tag docker.io/mirrorgooglecontainers/etcd-amd64:3.2.24 k8s.gcr.io/etcd:3.2.24
1589 docker tag docker.io/mirrorgooglecontainers/pause:3.1 k8s.gcr.io/pause:3.1
1590 docker tag docker.io/coredns/coredns:1.2.6 k8s.gcr.io/coredns:1.2.6

docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.16.2
docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.16.2
docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.16.2
docker pull mirrorgooglecontainers/etcd-amd64:3.3.15
docker pull coredns/coredns:1.6.2

docker tag docker.io/mirrorgooglecontainers/kube-proxy-amd64:v1.16.2 k8s.gcr.io/kube-proxy:v1.16.2
docker tag docker.io/mirrorgooglecontainers/kube-scheduler-amd64:v1.16.2 k8s.gcr.io/kube-scheduler:v1.16.2
docker tag docker.io/mirrorgooglecontainers/kube-controller-manager-amd64:v1.16.2 k8s.gcr.io/kube-controller-manager:v1.16.2
docker tag docker.io/mirrorgooglecontainers/etcd-amd64:3.3.15 k8s.gcr.io/etcd:3.3.15
docker tag docker.io/coredns/coredns:1.6.2 k8s.gcr.io/coredns:1.6.2
1595 ip r
1596 kubectl -h
1597 docker pull nginx-deploy
1598 kubectl run nginx-deploy --image=nginx:1.14-alpine --port=80 --replicas=1 --dry-run=true
1599 kubectl run nginx-deploy --image=nginx:1.14-alpine --port=80 --replicas=1
1600 ip r
1601 kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.176.1
1602 docker pull k8s.gcr.io/kube-apiserver:v
1603 kubeadm reset
1604 docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.16.2
1605 docker rm mirrorgooglecontainers/kube-apiserver-amd64:v1.13.2
1606 docker rm kube-apiserver-amd64:v1.13.2
1607 docker images
1608 docker tag mirrorgooglecontainers/kube-apiserver-amd64:v1.16.2 k8s.gcr.io/kube-apiserver:v1.16.2
1609 docker images | grep kube-apiserver

1641 kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.176.1
1642 docker images | grep etcd
1643 docker pull mirrorgooglecontainers/etcd-amd64:3.3.15-0
1644 docker images | grep etcd
1645 docker tag docker.io/mirrorgooglecontainers/etcd-amd64:3.3.15-0 k8s.gcr.io/etcd:3.3.15-0
1646 kubeadm reset
1647 kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.176.1
1648 kubectl run nginx-deploy --image=nginx:1.14-alpine --port=80 --replicas=1 --dry-run=true
1649 pwd
1650 kubeadm config print init-defaults ClusterConfiguration >kubeadm.conf
1651 ls
1652 vi kubeadm.conf
1653 mkdir -p $HOME/.kube
1654 cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
1655 chown $(id -u):$(id -g) $HOME/.kube/config
1656 cd .kube/

1659 kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/canal/rbac.yaml
1660 kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/canal/canal.yaml
1661 kubeadm -v
1662 kubeadm --v
1663 kubctl --v
1664 kubectl -v
1665 ifconfig
1666 docker ps
1667 kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/canal/canal.yaml
1668 kubectl apply -f https://docs.projectcalico.org/v3.5/getting-started/kubernetes/installation/hosted/canal/canal.yaml
1669 kubectl get pod -n kube-system -o wide
1670 kubeadm token list
1671 kubectl get nodes
1672 ip -r
1673 ip r
1674 kubeadm reset
1675 ip -r
1676 ip r
1677 kubeadm init --pod-network-cidr=192.168.0.0/16 --kubernetes-version=v1.12.0 --apiserver-advertise-address=

1681 kubeadm init --pod-network-cidr=192.168.0.0/16 --kubernetes-version=v1.12.0 --apiserver-advertise-address=192.168.176.1
1682 kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=192.168.176.1
1683 kubectl apply -f calico.yaml
1684 kubectl cluster-info
1685 kubectl get nodes
1686 kubectl apply -f calico.yaml
1687 kubectl
1688 kubectl get nodes
1689 mkdir -p $HOME/.kube
1690 pwd
1691 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
1692 sudo chown $(id -u):$(id -g) $HOME/.kube/config
1693 kubectl get nodes
1694 kubectl cluster-info
1695 kubectl get nodes
1696 kubectl -s http://localhost:8050 run nginx --image=nginx --port=80
1697 kubectl -s http://localhost:6443 run nginx --image=nginx --port=80
1698 kubctl get nodes
1699 kubectl get nodes
1700 kubectl get nodes -o wide
1701 kubectl run nginx --image nginx
1702 kubectl get pods --all-namespaces --show-all
1703 kubectl get pods
1704 kubectl get pods --all-namespaces --show-all
1705 kubectl get pods --all-namespaces
1706 kubectl get pods --all-namespaces --show-all
1707 kubectl get pods --all-namespaces
1708 vi nginx.yaml
1709 kubectl apply -f nginx.yaml
1710 kubectl get pods nginx -o wide
1711 vi nginx.yaml
1712 kubectl describe pod nginx
1713 kubectl get pods nginx -o wide
1714 kubectl get pods --all-namespaces --show-all
1715 kubectl get pods
1716 kubectl get pods --all-namespaces --show-all
1717 kubectl get pods nginx -o wide
1718 curl localhost
1719 kubectl get pods nginx -o wide
1720 kubectl stop pods nginx
1721 kubectl -h
1722 kubectl delete pods nginx
1723 kubectl get pods nginx -o wide
1724 vi nginx.yaml
1725 kubectl apply -f nginx.yaml
1726 kubectl get pods nginx -o wide
1727 docker
1728 docker ps
1729 kubectl get pods nginx -o wide
1730 kubectl get pods --all-namespaces --show-all
1731 kubectl describe pods
1732 curl localhost
1733 curl localhost:82
1734 history | grep kubectl
1735 kubectl get pod -n kube-system -o wide
1736 history |grep node
1737 kubectl get nodes -o wide
1738 curl 172.18.115.198:82
1739 ping 172.18.115.198
1740 curl host01:30393
1741 kubectl get services
1742 kubectl get nodes -o wide
1743 kubectl get pods --all-namespaces --show-all
1744 kubectl get pods --all-namespaces
1745 kubectl get nodes
1746 kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
1747 kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
1748 kubectl get services
1749 curl host01:30346
1750 curl 10.99.255.128:30346
1751 curl localhost:30346
1752 ip -r
1753 ip r
1754 curl 192.168.176.1:30346
1755 kubectl get nodes
1756 kubectl get pods --all-namespaces
1757 kubectl get services
1758 curl 10.99.255.128:30346
1759 cd /srv/
1760 ls
1761 cd /etc/
1762 ls
1763 cd nginx/
1764 ls
1765 vi nginx.conf
1766 cd sites-enabled/
1767 ls
1768 vi default
1769 kubectl get deployments
1770 kubectl get pods
1771 docker ps
1772 kubectl get deployments
1773 docker pskubectl cluster-info
1774 kubectl cluster-info
1775 curl 192.168.176.1:
1776 kubectl get services
1777 curl 192.168.176.1:30346
1778 curl host02:30346
1779 curl host03:30346
1780 curl 10.96.1:30346
1781 kubectl get rc
1782 kubectl get pods
1783 kubectl describe pods kubernetes-bootcamp-dd9784f6-9x579
1784 kubectl get services
1785 curl http://10.96.0.1:30346
1786 curl http://127.0.0.1:30346
1787 docker ps |grep 346
1788 kubectl version
1789 curl izuub4k63crvh5z:30346
1790 kubectl exec -it aaaaa -- /bin/sh
1791 kubectl get pods
1792 kubectl exec -it kubernetes-bootcamp-dd9784f6-9x579 -- /bin/sh
1793 kubectl exec -it nginx -- /bin/sh
1794 kubectl get services
1795 kubectl describe service/kubernetes-bootcamp
1796 kubectl get deployment
1797 kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
1798 kubectl get deployments
1799 kubectl get pods
1800 kubectl get nodes
1801 kubectl -h
1802 kubectl run
1803 kubectl get nodes
1804 systemctl restart docker
1805 docker ps
1806 kubectl get nodes
1807 journalctl -f -u kubelet
1808 hostnamectl status
1809 journalctl -f -u kubelet
1810 kubectl get nodes
1811 history | grep kubectl
1812 kubectl kubeadm reset
1813 history | grep kubeadm
1814 kubeadm reset
1815 kubectl get nodes
1816 history | grep kubeadm
1817 kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.176.1
1818 kubectl get nodes
1819 mkdir -p $HOME/.kube
1820 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
1821 sudo chown $(id -u):$(id -g) $HOME/.kube/config
1822 kubectl get nodes
1823 kubeadm join 192.168.176.1:6443 --token iin8fw.avaaqawreyu41r3s --discovery-token-ca-cert-hash sha256:be4d4600c22a71fb2f72e92c6fa6107d02dbfb3eca7b0d42fe2c690d120e3c4d
1824 kubectl get nodes
1825 kubeadm join 192.168.176.1:6443 --token iin8fw.avaaqawreyu41r3s --discovery-token-ca-cert-hash sha256:be4d4600c22a71fb2f72e92c6fa6107d02dbfb3eca7b0d42fe2c6
1826 kubectl get nodes
1827 kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/rbac.yaml

1831 kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/rbac.yaml
1832 ls
1833 pwd
1834 wget https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/rbac.yaml
1835 kubectl apply -f rbac.yaml
1836 kubectl get nodes
1837 kubectl apply -f rbac.yaml
1838 journalctl -f -u kubelet
1839 kubectl get pods --all-namespaces
1840 journalctl -f -u kubelet.service
1841 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml
1842 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
1843 vi kube-flannel.yml
1844 kubectl apply -f kube-flannel.yml
1845 journalctl -f -u kubelet.service
1846 kubectl get node
1847 journalctl -f -u kubelet.service
1848 kubectl get pods
1849 journalctl -f -u kubelet.service
1850 vi /etc/cni/net.d/10-flannel.conflist
1851 systemctl daemon-reload
1852 journalctl -
1853 kubectl get node
1854 kubectl cluster-info
1855 kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
1856 kubectl get node
1857 kubectl get pods
1858 kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
1859 kubectl get pods
1860 kubectl get deployments
1861 kubectl get services
1862 kubectl get pods
1863 kubectl describe pods
1864 kubectl get pods
1865 kubectl describe pods kubernetes-bootcamp
1866 kubectl get pods
1867 kubectl get pods kubernetes-bootcamp-dd9784f6-fwkrb
1868 kubectl describe pods kubernetes-bootcamp-dd9784f6-fwkrb
1869 history | grep join
1870 kubeadm join 192.168.176.1:6443 --token iin8fw.avaaqawreyu41r3s --discovery-token-ca-cert-hash sha256:be4d4600c22a71fb2f72e92c6fa6107d02dbfb3eca7b0d42fe2c690d120e3c4d
1871 kubectl get pods
1872 kubectl describe pods kubernetes-bootcamp-dd9784f6-fwkrb
1873 kubectl get nodes
1874 kubectl get pods
1875 kubectl get svc
1876 docker pull docker.io/jocatalin/kubernetes-bootcamp:v1
1877 kubectl get svc
1878 kubectl get pods
1879 kubectl delete pods
1880 kubectl delete pods --all
1881 kubectl get pods
1882 kubectl delete pods --all
1883 kubectl get pods
1884 kubectl get svc
1885 kubectl delete svc kubernetes-bootcamp
1886 kubectl delete pod kubernetes-bootcamp
1887 kubectl delete pods kubernetes-bootcamp
1888 kubectl delete pods --all
1889 kubectl get pods
1890 kubectl delete pods kubernetes-bootcamp-dd9784f6-bssqc
1891 kubectl get pods
1892 kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
1893 kubectl delete apps kubernetes-bootcamp
1894 kubectl get deployments
1895 kubectl delete kubernetes-bootcamp
1896 kubectl get deployments
1897 kubectl delete kubernetes-bootcamp
1898 kubectl delete deployments kubernetes-bootcamp
1899 kubectl delete pods kubernetes-bootcamp
1900 kubectl get deployments
1901 kubectl get pods
1902 kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
1903 kubectl get pods
1904 kubectl get deployments
1905 kubectl get pods
1906 docker pull docker.io/jocatalin/kubernetes-bootcamp:v1
1907 kubectl get pods
1908 kubectl get deployments
1909 kubectl describe pods kubernetes-bootcamp-dd9784f6-hxxlv
1910 kubectl
1911 kubectl describe nodes izuub4k63crvh5z
1912 kubectl describe nodes izuub4k63crvh5z
1913 kubectl get pods
1914 kubectl delete pods kubernetes-bootcamp
1915 kubectl get deployments
1916 kubectl delete deployments kubernetes-bootcamp
1917 kubectl delete pods kubernetes-bootcamp
1918 kubectl get deployments
1919 kubectl get pods
1920 kubectl describe nodes izuub4k63crvh5z
1921 kubectl label node izuub4k63crvh5z node-role.kubernetes.io/infra=true
1922 kubectl run kubernetes-bootcamp --image=kubernetes-bootcamp:v1 --port=8080
1923 kubectl get pods
1924 kubectl get deployments
1925 kubectl get pods
1926 kubectl describe pods kubernetes-bootcamp-85c84b78cf-f997v
1927 kubectl get nodes
1928 kubectl run kubernetes-bootcamp --image=kubernetes-bootcamp:v1 --port=8080
1929 ls
1930 kubectl get nodes
1931 kubectl get pods
1932 kubectl describe pods kubernetes-bootcamp-85c84b78cf-f997v
1933 kubectl taint nodes --all node-role.kubernetes.io/master-
1934 kubectl taint nodes --all node-role.kubernetes.io/master
1935 kubectl taint nodes --all node-role.kubernetes.io/master-
1936 kubectl describe pods kubernetes-bootcamp-85c84b78cf-f997v
1937 kubectl get pods
1938 kubectl describe pods kubernetes-bootcamp-85c84b78cf-f997v
1939 kubectl delete deployments kubernetes-bootcamp
1940 kubectl delete pods kubernetes-bootcamp
1941 kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080
1942 kubectl get pods
1943 kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
1944 kubectl get scv
1945 kubectl get svc
1946 kubectl get deployments
1947 curl 127.0.0.1:31697
1948 kubectl get deployments
1949 kubectl scale deployments/kubernetes-bootcamp --replicas=3
1950 kubectl get deployments
1951 curl 127.0.0.1:31697
1952 kubectl scale deployments/kubernetes-bootcamp --replicas=1
1953 kubectl get deployments
1954 curl 127.0.0.1:31697
1955 kubectl scale deployments/kubernetes-bootcamp --replicas=2
1956 kubectl get pods
1957 kubectl get svc
1958 kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2
1959 kubectl get pods
1960 kubectl get svc
1961 curl localhost:31697
1962 kubectl rollout undo deployments/kubernetes-bootcamp
1963 curl localhost:31697
1964 kubectl rollout undo deployments/kubernetes-bootcamp
1965 curl localhost:31697
1966 kubectl rollout undo deployments/kubernetes-bootcamp
1967 curl localhost:31697
1968 kubectl get deployments
1969 curl localhost:31697
1970 docker ps
1971 docker ps | grep 31697
1972 curl localhost:31697
1973 docker ps | grep 31697
1974 etcdctl ls /registry
1975 etcdctl ls
1976 brctl show
1977 kubectl show
1978 journalctl -xefu kubelet
1979 kubectl cluster-info
1980 kubectl get nodes
1981 nslookup
1982 kubectl get cs
1983 kubectl get cs -a
1984 kubectl get cs
1985 kubectl logs coredns-78d4cf999f-qhb7p -n kube-system
1986 kubectl get pods
1987 kubectl logs kubernetes-bootcamp-dd9784f6-666kv -n kube-system
1988 kubectl logs kubernetes-bootcamp -n kube-system
1989 kubectl get pods -n kube-system
1990 kubectl logs coredns-5644d7b6d9-2kqcw -n kube-system
1991 cd /srv/adms
1992 ls
1993 vi docker-compose.yml
1994 ls
1995 clear
1996 history >> histku.txt