包含标签 k8s 的文章

k8s_给你的服务签发证书

使用场景 当我们需要进行服务端认证,甚至双向认证时,我们需要生成密钥对和服务信息,并使用ca对公钥和服务信息进行批准签发,生成一个证书。 我们简单描述下单向认证和双向认证的场景流程 在单向认证场景中: 服务端会将自己的证书和公钥告知客户端 客户端向CA查询该证书的合法性,确认合法后会记录服……

阅读全文

k8s网络模型

基础原则 每个Pod都拥有一个独立的IP地址,而且假定所有Pod都在一个可以直接连通的、扁平的网络空间中,不管是否运行在同一Node上都可以通过Pod的IP来访问。 对于支持主机网络的平台,其Pod若采用主机网络方式,则Pod仍然可以不通过NAT的方式访问其余的Pod k8s中Pod的……

阅读全文

ovs-fields

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140……

阅读全文

SNAT和DNAT

参考 SNAT In Source Network Address Translation (SNAT), the NAT router modifies the IP address of the sender in IP packets. SNAT is commonly used to enable hosts with private addresses to communicate with servers on the public Internet. RFC 1918 reserves the following three subnets as private addresses: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 DNAT In Destination Network Address Translation (DNAT), the NAT router modifies the IP address of the destination in IP packet headers. OpenStack uses DNAT to route packets from instances to the OpenStack metadata service. Applications running inside of instances access the OpenStack metadata service by making HTTP GET requests to a web server with IP address 169.254.169.254. In an OpenStack deployment, there is no host with this IP address. Instead, OpenStack uses DNAT to change the destination IP of these packets so they reach the network interface……

阅读全文

修改Centos官方云镜像的root密码

https://developer.aliyun.com/article/799104 还可以看看这个 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 yum -y install libguestfs-tools 要设置root密码,请使用以下命令: virt-customize -a CentOS-7-x86_64-GenericCloud.qcow2 --root-password password:123456 [ 0.0] Examining the guest ... [ 1.9] Setting a random seed [ 1.9] Setting passwords [ 6.8] Finishing off 注: CentOS-7-x86_64-GenericCloud.qcow2是要修改图像的名称。 123456是为root用户设置的密码。……

阅读全文

免费arp

免费(Free ARP)的作用是什么 解决方案 A:主机主动使用自己的IP地址作为目标地址发送ARP请求,此种方式称免费ARP。免费ARP有两个方面的作用: 用于检查重复的IP地址 正常情况下应当不能收到ARP回应,如果收到,则表明本网络中存在与自身IP地址重复的地址。 2.用于通告一个新的……

阅读全文

容器化和kvm的区别

容器和KVM虚拟化是两种不同的虚拟化技术,它们各有优缺点,适用于不同的场景。 容器 容器是一种轻量级的虚拟化技术,利用操作系统层面的虚拟化实现。每个容器都运行在一个独立的命名空间中,可以看作是进程的一个集合,共享主机操作系统的内核。容器可以快速启动、停止和迁移,占用的资源比KVM虚拟……

阅读全文

查看POD的IP地址

从外面看Pod IP地址之Kubernetes API kubectl get pod或者kubectl describe pod就可以 如果运行在容器内的进程希望获取该容器的IP,可以通过环境变量的方式来获取IP 1 2 3 4 5 6 7 8 9 10 spec: containers: - name: env-pod image: busybox command: ["/bin/sh", "-c","env"] env: - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP 从外面看Pod IP之docker命令 假设容器的ID是6e81……

阅读全文

网卡的混杂模式

混杂模式(英语:promiscuous mode)是指一台机器的网卡能够接收所有经过它的数据流,而不论其目的地址是否是它。 一般计算机网卡都工作在非混杂模式下,此时网卡只接受来自网络端口的目的地址指向自己的数据。当网卡工作在混杂模式下时,网卡将来自接口的所有数据都捕获并交给相应的驱动……

阅读全文

k8s网络

k8s网络模型设计的一个基础原则是:每个Pod都拥有一个独立的IP地址,而且假定所有Pod都在一个可以直接连通的、扁平的网络空间中。 所以不管他们是否运行在同一个Node(宿主机中),都要求他们可以直接通过对方的IP进行访问。 设计这个原则的原因是,用户不需要额外考虑如何建立Pod之……

阅读全文