kubernetes版本1.22.3
问题1:
Error from server: Get "https://192.168.88.103:10250/containerLogs/default/client/client": dial tcp 192.168.88.103:10250: connect: no route to host
解决方法
[root@node2 ~]
[root@node2 ~]
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
kubectl 命令
[root@master bak]
Name: node1
Roles: <none>
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/arch=amd64
kubernetes.io/hostname=node1
kubernetes.io/os=linux
Annotations: flannel.alpha.coreos.com/backend-data: {"VNI":1,"VtepMAC":"72:c5:c4:bc:31:ff"}
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: true
flannel.alpha.coreos.com/public-ip: 192.168.88.102
kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
node.alpha.kubernetes.io/ttl: 0
volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp: Wed, 03 Nov 2021 10:45:38 -0400
Taints: <none>
Unschedulable: false
Lease:
HolderIdentity: node1
AcquireTime: <unset>
RenewTime: Wed, 03 Nov 2021 11:12:26 -0400
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
NetworkUnavailable False Wed, 03 Nov 2021 10:45:46 -0400 Wed, 03 Nov 2021 10:45:46 -0400 FlannelIsUp Flannel is running on this node
MemoryPressure False Wed, 03 Nov 2021 11:11:04 -0400 Wed, 03 Nov 2021 10:45:38 -0400 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Wed, 03 Nov 2021 11:11:04 -0400 Wed, 03 Nov 2021 10:45:38 -0400 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Wed, 03 Nov 2021 11:11:04 -0400 Wed, 03 Nov 2021 10:45:38 -0400 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Wed, 03 Nov 2021 11:11:04 -0400 Wed, 03 Nov 2021 10:45:48 -0400 KubeletReady kubelet is posting ready status
Addresses:
InternalIP: 192.168.88.102
Hostname: node1
Capacity:
cpu: 4
ephemeral-storage: 38815216Ki
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 7992344Ki
pods: 110
Allocatable:
cpu: 4
ephemeral-storage: 35772103007
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 7889944Ki
pods: 110
System Info:
Machine ID: 53c69389ae554f4f83ed809bd51dddca
System UUID: BF9C4D56-0FE6-5083-0565-16792C78EDF6
Boot ID: d4fd0a95-b88f-42af-8822-696d59b63542
Kernel Version: 3.10.0-862.el7.x86_64
OS Image: CentOS Linux 7 (Core)
Operating System: linux
Architecture: amd64
Container Runtime Version: docker://20.10.10
Kubelet Version: v1.22.3
Kube-Proxy Version: v1.22.3
PodCIDR: 192.168.2.0/24
PodCIDRs: 192.168.2.0/24
Non-terminated Pods: (2 in total)
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age
--------- ---- ------------ ---------- --------------- ------------- ---
kube-system kube-flannel-ds-dfvsb 100m (2%) 100m (2%) 50Mi (0%) 50Mi (0%) 35m
kube-system kube-proxy-gn9nj 0 (0%) 0 (0%) 0 (0%) 0 (0%) 35m
Allocated resources:
(Total limits may be over 100 percent, i.e., overcommitted.)
Resource Requests Limits
-------- -------- ------
cpu 100m (2%) 100m (2%)
memory 50Mi (0%) 50Mi (0%)
ephemeral-storage 0 (0%) 0 (0%)
hugepages-1Gi 0 (0%) 0 (0%)
hugepages-2Mi 0 (0%) 0 (0%)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Starting 26m kube-proxy
Normal Starting 34m kube-proxy
Normal NodeHasSufficientMemory 35m kubelet Node node1 status is now: NodeHasSufficientMemory
Normal NodeHasNoDiskPressure 35m kubelet Node node1 status is now: NodeHasNoDiskPressure
Normal NodeHasSufficientPID 35m kubelet Node node1 status is now: NodeHasSufficientPID
Normal NodeAllocatableEnforced 35m kubelet Updated Node Allocatable limit across pods
Normal Starting 35m kubelet Starting kubelet.
Normal NodeReady 34m kubelet Node node1 status is now: NodeReady
Normal Starting 26m kubelet Starting kubelet.
Normal NodeHasNoDiskPressure 26m (x2 over 26m) kubelet Node node1 status is now: NodeHasNoDiskPressure
Normal NodeHasSufficientPID 26m (x2 over 26m) kubelet Node node1 status is now: NodeHasSufficientPID
Normal NodeAllocatableEnforced 26m kubelet Updated Node Allocatable limit across pods
Normal NodeHasSufficientMemory 26m (x2 over 26m) kubelet Node node1 status is now: NodeHasSufficientMemory
Normal NodeReady 26m kubelet Node node1 status is now: NodeReady
[root@master bak]
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeState:"clean", BuildDate:"2021-10-27T18:41:28Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeState:"clean", BuildDate:"2021-10-27T18:35:25Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
[root@master bak]
Kubernetes control plane is running at https://192.168.88.101:6443
CoreDNS is running at https://192.168.88.101:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[root@master ~]
W1103 11:25:31.051890 100284 helpers.go:569] --dry-run=true is deprecated (boolean value) and can be replaced with --dry-run=client.
pod/nginx-deploy created (dry run)
[root@master ~]
deployment.apps/nginx-deploy created
[root@master ~]
service/nginx exposed
[root@master ~]
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 1 (74m ago) 14h
nginx-deploy-7c948bcff4-jclqg 1/1 Running 0 26m
nginx-deploy-7c948bcff4-mczxp 1/1 Running 0 26m
[root@master ~]
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 24h <none>
nginx ClusterIP 10.105.125.19 <none> 80/TCP 28m app=nginx-deploy
[root@master ~]
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@master ~]
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 23h
[root@master ~]
deployment.apps/client created
[root@master ~]
If you don't see a command prompt, try pressing enter.
/
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
/
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@master ~]
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.7 <<>> -t A nginx.default.svc.cluster.local @10.96.0.10
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31486
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nginx.default.svc.cluster.local. IN A
;; ANSWER SECTION:
nginx.default.svc.cluster.local. 30 IN A 10.105.125.19
;; Query time: 0 msec
;; SERVER: 10.96.0.10
;; WHEN: Sun Nov 07 09:54:21 EST 2021
;; MSG SIZE rcvd: 107
[root@master ~]
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 23h <none>
nginx ClusterIP 10.105.125.19 <none> 80/TCP 24m app=nginx-deploy
[root@master ~]
Name: nginx
Namespace: default
Labels: app=nginx-deploy
Annotations: <none>
Selector: app=nginx-deploy
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.105.125.19
IPs: 10.105.125.19
Port: <unset> 80/TCP
TargetPort: 80/TCP
Endpoints: 10.244.1.4:80,10.244.3.3:80
Session Affinity: None
Events: <none>
[root@master ~]
NAME READY STATUS RESTARTS AGE LABELS
client 1/1 Running 0 13m run=client
client-7c75c79d7c-h9994 0/1 CrashLoopBackOff 8 (58s ago) 16m app=client,pod-template-hash=7c75c79d7c
nginx 1/1 Running 1 (103m ago) 14h run=nginx
nginx-deploy-7c948bcff4-jclqg 1/1 Running 0 55m app=nginx-deploy,pod-template-hash=7c948bcff4
nginx-deploy-7c948bcff4-mczxp 1/1 Running 0 55m app=nginx-deploy,pod-template-hash=7c948bcff4
[root@master ~]
deployment.apps/nginx-deploy scaled
[root@master ~]
NAME READY STATUS RESTARTS AGE
client 1/1 Running 0 23m
client-7c75c79d7c-h9994 0/1 CrashLoopBackOff 10 (33s ago) 26m
nginx 1/1 Running 1 (113m ago) 14h
nginx-deploy-7c948bcff4-jclqg 1/1 Running 0 65m
nginx-deploy-7c948bcff4-lhq2q 1/1 Running 0 7s
nginx-deploy-7c948bcff4-mczxp 1/1 Running 0 65m
[root@master ~]
deployment.apps/nginx-deploy scaled
[root@master ~]
NAME READY STATUS RESTARTS AGE
client 1/1 Running 0 24m
client-7c75c79d7c-h9994 0/1 CrashLoopBackOff 10 (84s ago) 27m
nginx 1/1 Running 1 (114m ago) 14h
nginx-deploy-7c948bcff4-jclqg 1/1 Running 0 66m
nginx-deploy-7c948bcff4-mczxp 1/1 Running 0 66m
[root@master ~]
[root@master ~]
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 24h
nginx NodePort 10.105.125.19 <none> 80:31526/TCP 49m
|