65s 0 码力 |
1307 页 |
19.26 MB
| 2 年前 3 案例--如何创建一个Nginx
1. 创建无状态应用nginx
2. 配置容器
3. 高级配置
4. 创建成功
案例--如何创建一个WordPress
方法一:nodePort + Haproxy 外网访问 WordPress 配置方法
1. 创建 StorageClass、Namespace 和 pvc 资源
2. 部署MySQL容器组
Kubernetes 中默认的服务类型 (ServiceType),选择此种类型,对应的 Service 将被分配一个集群内部的 IP 地址,只能在集群内部被访问。
## NodePort
在每台 Node 的固定端口上暴露服务,选择 NodePort 的服务类型,集群会自动创建一个 ClusterIp 类型的服务,负责处理 Node 接收到的外部流量。集群外部的 Client 可以通过: 的方式访问该服务。 暴露服务,选择该值,服务只能够在集群内部可以访问,这也是默认的 ServiceType。
NodePort:通过每个 Node 上的 IP 和静态端口(NodePort)暴露服务。NodePort 服务会路由到 ClusterIP 服务,这个 ClusterIP 服务会自动创建。通过请求 :
<nodeport>,可以从集群的外部访问一个 NodePort 服务。
关联:选择服务要绑定的后端对象o。若不进行关联部署,则不会创建相关的 0 码力 |
94 页 |
9.98 MB
| 2 年前 3 pod-to-a-denied-cnp-6967cb6f7f-7h9fn 1/1
Running 0 66s
pod-to-b-intra-node-nodeport-9b487cf89-6ptrt 1/1
Running 0 65s
pod-to-b-multi-node-clusterip-7db5dfdcf7-jkjpw pod-to-b-multi-node-headless-7d44b85d69-mtscc 1/1
Running 0 66s
pod-to-b-multi-node-nodeport-7ffc76db7c-rrw82 1/1
Running 0 65s
pod-to-external-1111-d56f47579-d79dz pod-to-a-denied-cnp-6967cb6f7f-7h9fn 1/1
Running 0 66s
pod-to-b-intra-node-nodeport-9b487cf89-6ptrt 1/1
Running 0 65s
pod-to-b-multi-node-clusterip-7db5dfdcf7-jkjpw 0 码力 |
1373 页 |
19.37 MB
| 2 年前 3 pod-to-b-multi-node-headless-746f84dff5-prk4w 1/1 Running
0 4m49s
pod-to-b-multi-node-nodeport-7cb9c6cb8b-ksm4h 1/1 Running
0 4m49s
pod-to-external-fqdn-allow-google pod-to-b-multi-node-headless-746f84dff5-prk4w 1/1 Running
0 4m49s
pod-to-b-multi-node-nodeport-7cb9c6cb8b-ksm4h 1/1 Running
0 4m49s
pod-to-external-fqdn-allow-google global.hostServices.enabled=false \
--set global.externalIPs.enabled=true \
--set global.nodePort.enabled=true \
--set global.hostPort.enabled=true \
--set global.pullPolicy=IfNotPresent 0 码力 |
885 页 |
12.41 MB
| 2 年前 3 apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
name: frontend
spec:
type: NodePort
ports:
- port: 80
- protocol: "TCP"
- targetPort: 80
selector:
name: frontend service will be used. But if you want the service to be exposed to the outside world we have to use NodePort or LoadBalancer in "type" (Called ServiceType). If you don't specify any value, then connections only from within cluster.
NodePort proxies the port from service definition on the host and forwards all the traffic to intended container and port. NodePort is chosen randomly from a pre-configured 0 码力 |
66 页 |
6.10 MB
| 2 年前 3
16.6.2. 将 ExternalIP 附加到服务 ..... 232
16.6.3. 其他资源 ..... 234
16.7. 使用 NODEPORT 配置集群入口流量 ..... 234
16.7.1. 使用 NodePort 使流量进入集群 ..... 234
16.7.2. 先决条件 ..... 234
16.7.3. 创建项目和服务 ..... 234
16 ..
##### 6.3.2. Ingress 控制器端点发布策略
NodePortService 端点发布策略
NodePortService 端点发布策略使用 Kubernetes NodePort 服务发布 Ingress Controller。
在这个配置中,Ingress Controller 部署使用容器网络。创建了一个 NodePortService OpenShift 0222
上图显示了与 OpenShift Container Platform Ingress NodePort 端点发布策略相关的以下概念:
- 集群中的所有可用节点均有自己的外部可访问 IP 地址。集群中运行的服务绑定到所有节点的唯一NodePort。
当客户端连接到停机的节点时,例如通过连接图形中的 10.0.128.4 IP 地址,节点端口将客户端直接连接到运行 0 码力 |
256 页 |
2.78 MB
| 2 年前 3
|