salt 安装kubernetes集群3节点
[root@linux-node1 k8s]# tree
.
├── etcd.sls
├── files
│ ├── cfssl-1.2
│ │ ├── cfssl-certinfo_linux-amd64
│ │ ├── cfssljson_linux-amd64
│ │ └── cfssl_linux-amd64
│ ├── cni-plugins-amd64-v0.7.0
│ │ ├── bridge
│ │ ├── dhcp
│ │ ├── flannel
│ │ ├── host-device
│ │ ├── host-local
│ │ ├── ipvlan
│ │ ├── loopback
│ │ ├── macvlan
│ │ ├── portmap
│ │ ├── ptp
│ │ ├── sample
│ │ ├── tuning
│ │ └── vlan
│ ├── etcd-v3.3.1-linux-amd64
│ │ ├── etcd
│ │ └── etcdctl
│ ├── flannel-v0.10.0-linux-amd64
│ │ ├── flanneld
│ │ └── mk-docker-opts.sh
│ └── k8s-v1.10.3
│ └── bin
│ ├── kube-apiserver
│ ├── kube-controller-manager
│ ├── kubectl
│ ├── kubelet
│ ├── kube-proxy
│ └── kube-scheduler
├── flannel.sls
├── master.sls
├── modules
│ ├── api-server.sls
│ ├── base-dir.sls
│ ├── ca-file.sls
│ ├── cfssl.sls
│ ├── cni.sls
│ ├── controller-manager.sls
│ ├── docker.sls
│ ├── etcd.sls
│ ├── flannel.sls
│ ├── kubectl.sls
│ ├── kubelet.sls
│ ├── kube-proxy.sls
│ ├── master-ca.sls
│ └── scheduler.sls
├── node.sls
└── templates
├── ca
│ ├── ca-config.json
│ ├── ca.csr
│ ├── ca-csr.json
│ ├── ca-key.pem
│ └── ca.pem
├── cni
│ └── 10-default.conf.template
├── docker
│ ├── daemon.json.template
│ ├── docker-ce.repo.template
│ ├── docker-config.template
│ └── docker.service.template
├── etcd
│ ├── etcd.conf.template
│ ├── etcd-csr.json.template
│ └── etcd.service
├── flannel
│ ├── flannel-config.template
│ ├── flanneld-csr.json.template
│ ├── flannel-etcd.sh.template
│ ├── flannel.service.template
│ ├── mk-docker-opts.sh.template
│ └── remove-docker0.sh.template
├── kube-api-server
│ ├── basic-auth.csv.template
│ ├── bootstrap_token.csv.template
│ ├── kube-apiserver.service.template
│ └── kubernetes-csr.json.template
├── kube-controller-manager
│ └── kube-controller-manager.service.template
├── kubectl
│ └── admin-csr.json.template
├── kubelet
│ └── kubelet.service.template
├── kube-proxy
│ ├── kube-proxy-csr.json.template
│ └── kube-proxy.service.template
└── kube-scheduler
└── kube-scheduler.service.template
20 directories, 73 files
[root@linux-node1 k8s]#
[root@linux-node1 k8s]# ls
etcd.sls files flannel.sls master.sls modules node.sls templates
[root@linux-node1 k8s]# cd templates/
[root@linux-node1 templates]# ll
total 0
drwxr-xr-x 2 root root 93 Oct 23 13:50 ca
drwxr-xr-x 2 root root 38 Oct 23 13:50 cni
drwxr-xr-x 2 root root 126 Oct 23 13:50 docker
drwxr-xr-x 2 root root 82 Oct 23 13:50 etcd
drwxr-xr-x 2 root root 203 Oct 23 13:50 flannel
drwxr-xr-x 2 root root 148 Oct 23 13:50 kube-api-server
drwxr-xr-x 2 root root 54 Oct 23 13:50 kube-controller-manager
drwxr-xr-x 2 root root 37 Oct 23 13:50 kubectl
drwxr-xr-x 2 root root 38 Oct 23 13:50 kubelet
drwxr-xr-x 2 root root 77 Oct 23 13:50 kube-proxy
drwxr-xr-x 2 root root 45 Oct 23 13:50 kube-scheduler
[root@linux-node1 templates]# cd ..
[root@linux-node1 k8s]# ll
total 16
-rw-r--r-- 1 root root 283 Oct 23 13:50 etcd.sls
drwxr-xr-x 7 root root 140 Jun 3 19:12 files
-rw-r--r-- 1 root root 323 Oct 23 13:50 flannel.sls
-rw-r--r-- 1 root root 492 Oct 23 13:50 master.sls
drwxr-xr-x 2 root root 284 Oct 23 13:50 modules
-rw-r--r-- 1 root root 669 Oct 23 13:50 node.sls
drwxr-xr-x 13 root root 192 Oct 23 13:50 templates
[root@linux-node1 k8s]#
oot@linux-node1 k8s]# vim /etc/salt/roster
▽
# -*- coding: utf-8 -*-
#******************************************
# Author: Jason Zhao
# Email: shundong.zhao@linuxhot.com
# Organization: http://www.devopsedu.com/
# Description: Salt SSH Roster
#******************************************
linux-node1:
host: 192.168.31.160
user: root
priv: /root/.ssh/id_rsa
minion_opts:
grains:
k8s-role: master
etcd-role: node
etcd-name: etcd-node1
# -*- coding: utf-8 -*-
#******************************************
# Author: Jason Zhao
# Email: shundong.zhao@linuxhot.com
# Organization: http://www.devopsedu.com/
# Description: Salt SSH Roster
#******************************************
linux-node1:
host: 192.168.31.160
user: root
priv: /root/.ssh/id_rsa
minion_opts:
grains:
k8s-role: master
etcd-role: node
etcd-name: etcd-node1
linux-node2:
"/etc/salt/roster" 37L, 782C written
[root@linux-node1 k8s]#
oot@linux-node1 k8s]# vim /srv/pillar/k8s.sls
▽
# -*- coding: utf-8 -*-
#********************************************
# Author: Jason Zhao
# Email: shundong.zhao@linuxhot.com
# Organization: http://www.devopsedu.com/
# Description: Kubernetes Config with Pillar
#********************************************
#设置Master的IP地址(必须修改)
MASTER_IP: "192.168.31.160"
#设置ETCD集群访问地址(必须修改)
#设置ETCD集群初始化列表(必须修改)
#通过Grains FQDN自动获取本机IP地址,请注意保证主机名解析到本机IP地址
NODE_IP: {{ grains['fqdn_ip4'][0] }}
#设置BOOTSTARP的TOKEN,可以自己生成
BOOTSTRAP_TOKEN: "ad6d5bb607a186796d8861557df0d17f"
#配置Service IP地址段
# -*- coding: utf-8 -*-
#********************************************
# Author: Jason Zhao
# Email: shundong.zhao@linuxhot.com
# Organization: http://www.devopsedu.com/
# Description: Kubernetes Config with Pillar
#********************************************
#设置Master的IP地址(必须修改)
MASTER_IP: "192.168.31.160"
#设置ETCD集群访问地址(必须修改)
#设置ETCD集群初始化列表(必须修改)
#通过Grains FQDN自动获取本机IP地址,请注意保证主机名解析到本机IP地址
NODE_IP: {{ grains['fqdn_ip4'][0] }}
#设置BOOTSTARP的TOKEN,可以自己生成
BOOTSTRAP_TOKEN: "ad6d5bb607a186796d8861557df0d17f"
#配置Service IP地址段
# -*- coding: utf-8 -*-
#********************************************
# Author: Jason Zhao
# Email: shundong.zhao@linuxhot.com
# Organization: http://www.devopsedu.com/
# Description: Kubernetes Config with Pillar
#********************************************
#设置Master的IP地址(必须修改)
MASTER_IP: "192.168.31.160"
#设置ETCD集群访问地址(必须修改)
ETCD_ENDPOINTS: "https://192.168.31.160:2379,https://192.168.31.161:2379,https://192.168.31.162
:2379"
#设置ETCD集群初始化列表(必须修改)
ETCD_CLUSTER: "etcd-node1=https://192.168.31.160:2380,etcd-node2=https://192.168.31.161:2380,et
cd-node3=https://192.168.31.162:2380"
"/srv/pillar/k8s.sls" 43L, 1402C written
[root@linux-node1 k8s]#
[root@linux-node1 k8s]# salt-ssh '*' test.ping
linux-node1:
True
linux-node3:
True
linux-node2:
True
[root@linux-node1 k8s]#
[root@linux-node1 k8s]# salt-ssh -L 'linux-node1,linux-node2,linux-node3' state.sls k8s.etcd
linux-node2:
----------
ID: kubernetes-dir
Function: file.directory
Name: /opt/kubernetes
Result: True
Comment: The directory /opt/kubernetes is in the correct state
Started: 13:58:35.513781
Duration: 73.838 ms
Changes:
----------
ID: kubernetes-bin
Function: file.directory
Name: /opt/kubernetes/bin
Result: True
Comment: The directory /opt/kubernetes/bin is in the correct state
Started: 13:58:35.587866
Duration: 1.361 ms
Changes:
----------
ID: kubernetes-config
Function: file.directory
Name: /opt/kubernetes/cfg
Result: True
Comment: The directory /opt/kubernetes/cfg is in the correct state
Started: 13:58:35.589429
Duration: 1.269 ms
Changes:
----------
ID: kubernetes-ssl
Function: file.directory
Name: /opt/kubernetes/ssl
Result: True
Comment: The directory /opt/kubernetes/ssl is in the correct state
Started: 13:58:35.590898
Duration: 1.293 ms
Changes:
----------
ID: kubernetes-log
Function: file.directory
Name: /opt/kubernetes/log
Result: True
Comment: The directory /opt/kubernetes/log is in the correct state
Started: 13:58:35.592399
Duration: 1.268 ms
Changes:
----------
ID: path-env
Function: file.append
Name: /etc/profile
Result: True
Comment: Appended 1 lines
Started: 13:58:35.593866
Duration: 6.75 ms
Changes:
----------
diff:
---
+++
@@ -74,3 +74,4 @@
unset i
unset -f pathmunge
+export PATH=$PATH:/opt/kubernetes/bin
----------
ID: init-pkg
Function: pkg.installed
Name: nfs-utils
Result: True
Comment: The following packages were installed/updated: nfs-utils
Started: 13:58:39.574537
Duration: 18261.117 ms
Changes:
----------
gssproxy:
----------
new:
0.7.0-17.el7
old:
keyutils:
----------
new:
1.5.8-3.el7
old:
libbasicobjects:
----------
new:
0.1.1-29.el7
old:
libcollection:
----------
new:
0.7.0-29.el7
old:
libevent:
----------
new:
2.0.21-4.el7
old:
libini_config:
----------
new:
1.3.1-29.el7
old:
libnfsidmap:
----------
new:
0.25-19.el7
old:
libpath_utils:
----------
new:
0.2.1-29.el7
old:
libref_array:
----------
new:
0.1.5-29.el7
old:
libverto-libevent:
----------
new:
0.2.5-4.el7
old:
nfs-utils:
----------
new:
1:1.3.0-0.54.el7
old:
----------
ID: init-pkg
Function: pkg.installed
Name: socat
Result: True
Comment: The following packages were installed/updated: socat
Started: 13:58:57.880581
Duration: 6237.064 ms
Changes:
----------
socat:
----------
new:
1.7.3.2-2.el7
old:
----------
ID: cfssl-certinfo
Function: file.managed
Name: /opt/kubernetes/bin/cfssl-certinfo
Result: True
Comment: File /opt/kubernetes/bin/cfssl-certinfo updated
Started: 13:59:04.129092
Duration: 203.587 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl-json
Function: file.managed
Name: /opt/kubernetes/bin/cfssljson
Result: True
Comment: File /opt/kubernetes/bin/cfssljson updated
Started: 13:59:04.333046
Duration: 47.669 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl
Function: file.managed
Name: /opt/kubernetes/bin/cfssl
Result: True
Comment: File /opt/kubernetes/bin/cfssl updated
Started: 13:59:04.381079
Duration: 166.382 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ca-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca.pem updated
Started: 13:59:04.547793
Duration: 14.837 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-key-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca-key.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca-key.pem updated
Started: 13:59:04.562956
Duration: 13.987 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-csr
Function: file.managed
Name: /opt/kubernetes/ssl/ca.csr
Result: True
Comment: File /opt/kubernetes/ssl/ca.csr updated
Started: 13:59:04.577288
Duration: 14.109 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-config-json
Function: file.managed
Name: /opt/kubernetes/ssl/ca-config.json
Result: True
Comment: File /opt/kubernetes/ssl/ca-config.json updated
Started: 13:59:04.591714
Duration: 14.383 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcd
Result: True
Comment: File /opt/kubernetes/bin/etcd updated
Started: 13:59:04.606416
Duration: 303.554 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: etcdctl-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcdctl
Result: True
Comment: File /opt/kubernetes/bin/etcdctl updated
Started: 13:59:04.910353
Duration: 252.423 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ectd-csr-json
Function: file.managed
Name: /opt/kubernetes/ssl/etcd-csr.json
Result: True
Comment: File /opt/kubernetes/ssl/etcd-csr.json updated
Started: 13:59:05.163323
Duration: 45.805 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-ssl
Function: cmd.run
Name: cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd
Result: True
Comment: Command "cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd" run
Started: 13:59:05.216657
Duration: 607.065 ms
Changes:
----------
pid:
17790
retcode:
0
stderr:
2018/10/24 13:59:05 [INFO] generate received request
2018/10/24 13:59:05 [INFO] received CSR
2018/10/24 13:59:05 [INFO] generating key: rsa-2048
2018/10/24 13:59:05 [INFO] encoded CSR
2018/10/24 13:59:05 [INFO] signed certificate with serial number 629820405032023677278470176218489019194896492946
2018/10/24 13:59:05 [WARNING] This certificate lacks a "hosts" field. This makes it unsuitable for
websites. For more information see the Baseline Requirements for the Issuance and Management
of Publicly-Trusted Certificates, v.1.1.6, from the CA/Browser Forum (https://cabforum.org);
specifically, section 10.2.3 ("Information Requirements").
stdout:
----------
ID: etcd-dir
Function: file.directory
Name: /var/lib/etcd
Result: True
Comment: Directory /var/lib/etcd updated
Started: 13:59:05.824117
Duration: 2.21 ms
Changes:
----------
/var/lib/etcd:
New Dir
----------
ID: etcd-config
Function: file.managed
Name: /opt/kubernetes/cfg/etcd.conf
Result: True
Comment: File /opt/kubernetes/cfg/etcd.conf updated
Started: 13:59:05.826549
Duration: 43.819 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: file.managed
Name: /usr/lib/systemd/system/etcd.service
Result: True
Comment: File /usr/lib/systemd/system/etcd.service updated
Started: 13:59:09.019517
Duration: 16.213 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: cmd.run
Name: systemctl daemon-reload
Result: True
Comment: Command "systemctl daemon-reload" run
Started: 13:59:09.036988
Duration: 61.599 ms
Changes:
----------
pid:
17806
retcode:
0
stderr:
stdout:
----------
ID: etcd-service
Function: service.running
Name: etcd
Result: True
Comment: Service etcd has been enabled, and is running
Started: 13:59:09.099424
Duration: 28640.068 ms
Changes:
----------
etcd:
True
Summary for linux-node2
-------------
Succeeded: 24 (changed=19)
Failed: 0
-------------
Total states run: 24
Total run time: 55.032 s
linux-node3:
----------
ID: kubernetes-dir
Function: file.directory
Name: /opt/kubernetes
Result: True
Comment: The directory /opt/kubernetes is in the correct state
Started: 13:58:33.538271
Duration: 78.934 ms
Changes:
----------
ID: kubernetes-bin
Function: file.directory
Name: /opt/kubernetes/bin
Result: True
Comment: The directory /opt/kubernetes/bin is in the correct state
Started: 13:58:33.617462
Duration: 1.336 ms
Changes:
----------
ID: kubernetes-config
Function: file.directory
Name: /opt/kubernetes/cfg
Result: True
Comment: The directory /opt/kubernetes/cfg is in the correct state
Started: 13:58:33.619001
Duration: 1.25 ms
Changes:
----------
ID: kubernetes-ssl
Function: file.directory
Name: /opt/kubernetes/ssl
Result: True
Comment: The directory /opt/kubernetes/ssl is in the correct state
Started: 13:58:33.620447
Duration: 1.271 ms
Changes:
----------
ID: kubernetes-log
Function: file.directory
Name: /opt/kubernetes/log
Result: True
Comment: The directory /opt/kubernetes/log is in the correct state
Started: 13:58:33.621917
Duration: 1.247 ms
Changes:
----------
ID: path-env
Function: file.append
Name: /etc/profile
Result: True
Comment: Appended 1 lines
Started: 13:58:33.623372
Duration: 6.715 ms
Changes:
----------
diff:
---
+++
@@ -74,3 +74,4 @@
unset i
unset -f pathmunge
+export PATH=$PATH:/opt/kubernetes/bin
----------
ID: init-pkg
Function: pkg.installed
Name: nfs-utils
Result: True
Comment: The following packages were installed/updated: nfs-utils
Started: 13:58:38.105432
Duration: 18440.665 ms
Changes:
----------
gssproxy:
----------
new:
0.7.0-17.el7
old:
keyutils:
----------
new:
1.5.8-3.el7
old:
libbasicobjects:
----------
new:
0.1.1-29.el7
old:
libcollection:
----------
new:
0.7.0-29.el7
old:
libevent:
----------
new:
2.0.21-4.el7
old:
libini_config:
----------
new:
1.3.1-29.el7
old:
libnfsidmap:
----------
new:
0.25-19.el7
old:
libpath_utils:
----------
new:
0.2.1-29.el7
old:
libref_array:
----------
new:
0.1.5-29.el7
old:
libverto-libevent:
----------
new:
0.2.5-4.el7
old:
nfs-utils:
----------
new:
1:1.3.0-0.54.el7
old:
----------
ID: init-pkg
Function: pkg.installed
Name: socat
Result: True
Comment: The following packages were installed/updated: socat
Started: 13:58:56.591725
Duration: 6872.345 ms
Changes:
----------
socat:
----------
new:
1.7.3.2-2.el7
old:
----------
ID: cfssl-certinfo
Function: file.managed
Name: /opt/kubernetes/bin/cfssl-certinfo
Result: True
Comment: File /opt/kubernetes/bin/cfssl-certinfo updated
Started: 13:59:03.475470
Duration: 219.083 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl-json
Function: file.managed
Name: /opt/kubernetes/bin/cfssljson
Result: True
Comment: File /opt/kubernetes/bin/cfssljson updated
Started: 13:59:03.694921
Duration: 49.167 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl
Function: file.managed
Name: /opt/kubernetes/bin/cfssl
Result: True
Comment: File /opt/kubernetes/bin/cfssl updated
Started: 13:59:03.744419
Duration: 164.78 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ca-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca.pem updated
Started: 13:59:03.909624
Duration: 14.456 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-key-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca-key.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca-key.pem updated
Started: 13:59:03.924394
Duration: 13.878 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-csr
Function: file.managed
Name: /opt/kubernetes/ssl/ca.csr
Result: True
Comment: File /opt/kubernetes/ssl/ca.csr updated
Started: 13:59:03.938590
Duration: 14.881 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-config-json
Function: file.managed
Name: /opt/kubernetes/ssl/ca-config.json
Result: True
Comment: File /opt/kubernetes/ssl/ca-config.json updated
Started: 13:59:03.953813
Duration: 14.13 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcd
Result: True
Comment: File /opt/kubernetes/bin/etcd updated
Started: 13:59:03.968262
Duration: 294.335 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: etcdctl-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcdctl
Result: True
Comment: File /opt/kubernetes/bin/etcdctl updated
Started: 13:59:04.263115
Duration: 269.757 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ectd-csr-json
Function: file.managed
Name: /opt/kubernetes/ssl/etcd-csr.json
Result: True
Comment: File /opt/kubernetes/ssl/etcd-csr.json updated
Started: 13:59:04.533208
Duration: 45.387 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-ssl
Function: cmd.run
Name: cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd
Result: True
Comment: Command "cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd" run
Started: 13:59:04.585756
Duration: 527.937 ms
Changes:
----------
pid:
17879
retcode:
0
stderr:
2018/10/24 13:59:04 [INFO] generate received request
2018/10/24 13:59:04 [INFO] received CSR
2018/10/24 13:59:04 [INFO] generating key: rsa-2048
2018/10/24 13:59:05 [INFO] encoded CSR
2018/10/24 13:59:05 [INFO] signed certificate with serial number 76971090450276395336817381670953830630769051069
2018/10/24 13:59:05 [WARNING] This certificate lacks a "hosts" field. This makes it unsuitable for
websites. For more information see the Baseline Requirements for the Issuance and Management
of Publicly-Trusted Certificates, v.1.1.6, from the CA/Browser Forum (https://cabforum.org);
specifically, section 10.2.3 ("Information Requirements").
stdout:
----------
ID: etcd-dir
Function: file.directory
Name: /var/lib/etcd
Result: True
Comment: Directory /var/lib/etcd updated
Started: 13:59:05.114083
Duration: 2.142 ms
Changes:
----------
/var/lib/etcd:
New Dir
----------
ID: etcd-config
Function: file.managed
Name: /opt/kubernetes/cfg/etcd.conf
Result: True
Comment: File /opt/kubernetes/cfg/etcd.conf updated
Started: 13:59:05.116443
Duration: 43.386 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: file.managed
Name: /usr/lib/systemd/system/etcd.service
Result: True
Comment: File /usr/lib/systemd/system/etcd.service updated
Started: 13:59:08.673561
Duration: 1958.185 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: cmd.run
Name: systemctl daemon-reload
Result: True
Comment: Command "systemctl daemon-reload" run
Started: 13:59:10.632836
Duration: 5013.068 ms
Changes:
----------
pid:
17896
retcode:
0
stderr:
stdout:
----------
ID: etcd-service
Function: service.running
Name: etcd
Result: True
Comment: Service etcd has been enabled, and is running
Started: 13:59:15.646756
Duration: 22094.376 ms
Changes:
----------
etcd:
True
Summary for linux-node3
-------------
Succeeded: 24 (changed=19)
Failed: 0
-------------
Total states run: 24
Total run time: 56.143 s
linux-node1:
----------
ID: kubernetes-dir
Function: file.directory
Name: /opt/kubernetes
Result: True
Comment: The directory /opt/kubernetes is in the correct state
Started: 21:58:02.548608
Duration: 739.629 ms
Changes:
----------
ID: kubernetes-bin
Function: file.directory
Name: /opt/kubernetes/bin
Result: True
Comment: The directory /opt/kubernetes/bin is in the correct state
Started: 21:58:03.288463
Duration: 1.22 ms
Changes:
----------
ID: kubernetes-config
Function: file.directory
Name: /opt/kubernetes/cfg
Result: True
Comment: The directory /opt/kubernetes/cfg is in the correct state
Started: 21:58:03.289893
Duration: 1.186 ms
Changes:
----------
ID: kubernetes-ssl
Function: file.directory
Name: /opt/kubernetes/ssl
Result: True
Comment: The directory /opt/kubernetes/ssl is in the correct state
Started: 21:58:03.291257
Duration: 1.157 ms
Changes:
----------
ID: kubernetes-log
Function: file.directory
Name: /opt/kubernetes/log
Result: True
Comment: The directory /opt/kubernetes/log is in the correct state
Started: 21:58:03.292591
Duration: 1.194 ms
Changes:
----------
ID: path-env
Function: file.append
Name: /etc/profile
Result: True
Comment: Appended 1 lines
Started: 21:58:03.293983
Duration: 189.032 ms
Changes:
----------
diff:
---
+++
@@ -74,3 +74,4 @@
unset i
unset -f pathmunge
+export PATH=$PATH:/opt/kubernetes/bin
----------
ID: init-pkg
Function: pkg.installed
Name: nfs-utils
Result: True
Comment: The following packages were installed/updated: nfs-utils
Started: 21:58:06.669552
Duration: 57903478.045 ms
Changes:
----------
gssproxy:
----------
new:
0.7.0-17.el7
old:
keyutils:
----------
new:
1.5.8-3.el7
old:
libbasicobjects:
----------
new:
0.1.1-29.el7
old:
libcollection:
----------
new:
0.7.0-29.el7
old:
libevent:
----------
new:
2.0.21-4.el7
old:
libini_config:
----------
new:
1.3.1-29.el7
old:
libnfsidmap:
----------
new:
0.25-19.el7
old:
libpath_utils:
----------
new:
0.2.1-29.el7
old:
libref_array:
----------
new:
0.1.5-29.el7
old:
libverto-libevent:
----------
new:
0.2.5-4.el7
old:
nfs-utils:
----------
new:
1:1.3.0-0.54.el7
old:
----------
ID: init-pkg
Function: pkg.installed
Name: socat
Result: True
Comment: The following packages were installed/updated: socat
Started: 14:03:10.193162
Duration: 11678.501 ms
Changes:
----------
socat:
----------
new:
1.7.3.2-2.el7
old:
----------
ID: cfssl-certinfo
Function: file.managed
Name: /opt/kubernetes/bin/cfssl-certinfo
Result: True
Comment: File /opt/kubernetes/bin/cfssl-certinfo updated
Started: 14:03:21.883349
Duration: 554.875 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl-json
Function: file.managed
Name: /opt/kubernetes/bin/cfssljson
Result: True
Comment: File /opt/kubernetes/bin/cfssljson updated
Started: 14:03:22.438572
Duration: 50.092 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: cfssl
Function: file.managed
Name: /opt/kubernetes/bin/cfssl
Result: True
Comment: File /opt/kubernetes/bin/cfssl updated
Started: 14:03:22.489101
Duration: 170.809 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ca-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca.pem updated
Started: 14:03:22.660281
Duration: 65.665 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-key-pem
Function: file.managed
Name: /opt/kubernetes/ssl/ca-key.pem
Result: True
Comment: File /opt/kubernetes/ssl/ca-key.pem updated
Started: 14:03:22.726305
Duration: 15.161 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-csr
Function: file.managed
Name: /opt/kubernetes/ssl/ca.csr
Result: True
Comment: File /opt/kubernetes/ssl/ca.csr updated
Started: 14:03:22.741823
Duration: 15.937 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: ca-config-json
Function: file.managed
Name: /opt/kubernetes/ssl/ca-config.json
Result: True
Comment: File /opt/kubernetes/ssl/ca-config.json updated
Started: 14:03:22.758114
Duration: 15.466 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcd
Result: True
Comment: File /opt/kubernetes/bin/etcd updated
Started: 14:03:22.773904
Duration: 296.012 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: etcdctl-bin
Function: file.managed
Name: /opt/kubernetes/bin/etcdctl
Result: True
Comment: File /opt/kubernetes/bin/etcdctl updated
Started: 14:03:23.070275
Duration: 250.672 ms
Changes:
----------
diff:
New file
mode:
0755
----------
ID: ectd-csr-json
Function: file.managed
Name: /opt/kubernetes/ssl/etcd-csr.json
Result: True
Comment: File /opt/kubernetes/ssl/etcd-csr.json updated
Started: 14:03:23.321411
Duration: 41.806 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-ssl
Function: cmd.run
Name: cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd
Result: True
Comment: Command "cd /opt/kubernetes/ssl && /opt/kubernetes/bin/cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem -ca-key=/opt/kubernetes/ssl/ca-key.pem -config=/opt/kubernetes/ssl/ca-config.json -profile=kubernetes etcd-csr.json | /opt/kubernetes/bin/cfssljson -bare etcd" run
Started: 14:03:23.370802
Duration: 3274.441 ms
Changes:
----------
pid:
19735
retcode:
0
stderr:
2018/10/24 14:03:23 [INFO] generate received request
2018/10/24 14:03:23 [INFO] received CSR
2018/10/24 14:03:23 [INFO] generating key: rsa-2048
2018/10/24 14:03:26 [INFO] encoded CSR
2018/10/24 14:03:26 [INFO] signed certificate with serial number 334862949886376785099811826201119471957597274767
2018/10/24 14:03:26 [WARNING] This certificate lacks a "hosts" field. This makes it unsuitable for
websites. For more information see the Baseline Requirements for the Issuance and Management
of Publicly-Trusted Certificates, v.1.1.6, from the CA/Browser Forum (https://cabforum.org);
specifically, section 10.2.3 ("Information Requirements").
stdout:
----------
ID: etcd-dir
Function: file.directory
Name: /var/lib/etcd
Result: True
Comment: Directory /var/lib/etcd updated
Started: 14:03:26.645605
Duration: 2.094 ms
Changes:
----------
/var/lib/etcd:
New Dir
----------
ID: etcd-config
Function: file.managed
Name: /opt/kubernetes/cfg/etcd.conf
Result: True
Comment: File /opt/kubernetes/cfg/etcd.conf updated
Started: 14:03:26.647916
Duration: 361.421 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: file.managed
Name: /usr/lib/systemd/system/etcd.service
Result: True
Comment: File /usr/lib/systemd/system/etcd.service updated
Started: 14:03:33.742352
Duration: 18.088 ms
Changes:
----------
diff:
New file
mode:
0644
----------
ID: etcd-service
Function: cmd.run
Name: systemctl daemon-reload
Result: True
Comment: Command "systemctl daemon-reload" run
Started: 14:03:33.761604
Duration: 61.599 ms
Changes:
----------
pid:
19753
retcode:
0
stderr:
stdout:
----------
ID: etcd-service
Function: service.running
Name: etcd
Result: True
Comment: Service etcd has been enabled, and is running
Started: 14:03:33.824086
Duration: 1448.399 ms
Changes:
----------
etcd:
True
Summary for linux-node1
-------------
Succeeded: 24 (changed=19)
Failed: 0
-------------
Total states run: 24
Total run time: 57922.733 s
[root@linux-node1 k8s]#
salt 安装kubernetes集群3节点的更多相关文章
- CentOS 7.5 使用 yum 安装 Kubernetes 集群(二)
一.安装方式介绍 1.yum 安装 目前CentOS官方已经把Kubernetes源放入到自己的默认 extras 仓库里面,使用 yum 安装,好处是简单,坏处也很明显,需要官方更新 yum 源才能 ...
- Kubernetes(K8s) 安装(使用kubeadm安装Kubernetes集群)
背景: 由于工作发生了一些变动,很长时间没有写博客了. 概述: 这篇文章是为了介绍使用kubeadm安装Kubernetes集群(可以用于生产级别).使用了Centos 7系统. 一.Centos7 ...
- 从0到1使用Kubernetes系列(三):使用Ansible安装Kubernetes集群
前两期的文章介绍了Kubernetes基本概念和架构,用Kubeadm+Ansible搭建Kubernetes集群所需要的工具及其作用.本篇介绍怎么使用Ansible安装Kubernetes集群. 启 ...
- VirtualBox上使用kubeadm安装Kubernetes集群
之前一直使用minikube练习,为了更贴近生产环境,使用VirtualBox搭建Kubernetes集群. 为了不是文章凌乱,把在搭建过程中遇到的问题及解决方法记在了另一篇文章:安装Kubernet ...
- 安装Kubernetes集群时遇到的问题及解决方法
在搭建Kubernetes集群时遇到一些问题,记录在这里. 搭建过程在另一篇文章:VirtualBox上使用kubeadm安装Kubernetes集群 1. 虚拟机安装完CentOS7登录时遇到war ...
- Centos7上安装Kubernetes集群部署docker
一.安装前准备1.操作系统详情需要三台主机,都最小化安装 centos7.3,并update到最新 [root@master ~]# (Core) 角色 主机名 IPMaster master 192 ...
- 基于kubeamd初始化安装kubernetes集群
环境:master,etcd 172.16.1.5node1 172.16.1.6node2 172.16.1.7前提:1.基于主机名通信,/etc/hosts 2.时间同步3.关闭firewalld ...
- 二进制文件方式安装kubernetes集群
所有操作全部用root使用者进行,高可用一般建议大于等于3台的奇数,我们使用3台master来做高可用 练习环境说明: 参考GitHub master: kube-apiserver,kube-con ...
- centos7使用kubeadm安装kubernetes集群
参考资料:官方文档 一.虚拟机安装 配置说明: windows下使用vbox,centos17.6 min版,kubernetes的版本是1.14.1, 安装如下三台机器: 192.168.56.15 ...
随机推荐
- systemd bug: bz1437114 core:execute: fix fork() fail handling in exec_spawn()
问题现象 大量僵尸进程 root 32278 0.0 0.0 0 0 ? Z 05:39 0:00 [runuser] <defunct> root 32280 0.0 0.0 0 0 ? ...
- Kz.layedit-layui.layedit富文本编辑器拓展
项目介绍 首先欢迎使用 Kz.layedit!本项目基于layui.layedit富文本编辑器,在其之上拓展而来. 新增功能 html源码模式.插入hr水平线.段落格式.字体颜色.字体背景色.批量上传 ...
- 如何用IE打开Chrome浏览器
实现方式,用IE调用cmd命令打开chrome(注意:IE的ActiveX相关设置要启用) <script type="text/javascript"> functi ...
- ansible yum 模块 安装 vsftp
[root@ftp:/root] > ansible ansible01 -u root -k -m yum -a 'name=vsftpd state=latest' SSH password ...
- Android开发进度07
1,今日:目标:完成记账功能 2,昨天:账单的增删改查方法 3,收获:无 4,问题:SQLite表单出现问题,提交后软件直接退出
- 洛谷P1004 方格取数
网络流大法吼 不想用DP的我选择了用网络流-- 建模方法: 从源点向(1,1)连一条容量为2(走两次),费用为0的边 从(n,n)向汇点连一条容量为2,费用为0的边 每个方格向右边和下边的方格连一条容 ...
- STM32 关于HAL库硬件SPI要注意的问题总结
利用STM32CUbeMx编写程序,大大方便了开发,最近做的项目利用到了 STM32CUbeMx的硬件SP,这里对SPI的使用做一个总结. HAL库里的硬件SPI主要有以下几个库函数: /* hspi ...
- reac实现控制输入框字符长度
reac实现控制输入框字符长度 代码思路:
- 【codeforces 812A】Sagheer and Crossroads
[题目链接]:http://codeforces.com/contest/812/problem/A [题意] 有一个小箭头指的那个地方; 指的就是人行道路; 然后p[i]指的就是那4个人行道是不是绿 ...
- oauth2.0里回调地址返回code中如何让code不显示在URL里?
背景: 最近在调用对方提供的oauth2.0接口的时候,返回code在URL显示,但是会影响到本系统调用其他的菜单项的操作,所以想把返回的code值去掉. 解决办法: 想了各种解决办法,目前把 ...