fix: add NodePort configuration for frontend and ops-web services in k3s deployment
Deployment Config CI / Deployment Config (push) Has been cancelled
Deployment Config CI / Deployment Config (push) Has been cancelled
This commit is contained in:
+17
-1
@@ -63,6 +63,22 @@ kubectl apply -k deploy/k3s
|
|||||||
|
|
||||||
## 4. 访问
|
## 4. 访问
|
||||||
|
|
||||||
|
k3s 默认同时支持两种访问方式。
|
||||||
|
|
||||||
|
### 4.1 直接用节点 IP + 端口
|
||||||
|
|
||||||
|
`frontend` 和 `ops-web` 已固定为 NodePort:
|
||||||
|
|
||||||
|
- tenant admin: `http://<node-ip>:30080`
|
||||||
|
- ops admin: `http://<node-ip>:30081`
|
||||||
|
|
||||||
|
例如 NAS IP 是 `192.168.100.19`:
|
||||||
|
|
||||||
|
- tenant admin: `http://192.168.100.19:30080`
|
||||||
|
- ops admin: `http://192.168.100.19:30081`
|
||||||
|
|
||||||
|
### 4.2 用域名 Ingress
|
||||||
|
|
||||||
k3s 默认 Traefik 会接管 Ingress。先把域名指到 k3s 节点 IP:
|
k3s 默认 Traefik 会接管 Ingress。先把域名指到 k3s 节点 IP:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@@ -75,7 +91,7 @@ k3s 默认 Traefik 会接管 Ingress。先把域名指到 k3s 节点 IP:
|
|||||||
- tenant admin: `http://geo-rankly.local`
|
- tenant admin: `http://geo-rankly.local`
|
||||||
- ops admin: `http://ops.geo-rankly.local`
|
- ops admin: `http://ops.geo-rankly.local`
|
||||||
|
|
||||||
不改 hosts 时可用端口转发:
|
临时调试时也可用端口转发:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl -n geo-rankly port-forward svc/frontend 8088:80
|
kubectl -n geo-rankly port-forward svc/frontend 8088:80
|
||||||
|
|||||||
@@ -440,12 +440,14 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: frontend
|
app.kubernetes.io/name: frontend
|
||||||
spec:
|
spec:
|
||||||
|
type: NodePort
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: frontend
|
app.kubernetes.io/name: frontend
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: http
|
targetPort: http
|
||||||
|
nodePort: 30080
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -497,12 +499,14 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: ops-web
|
app.kubernetes.io/name: ops-web
|
||||||
spec:
|
spec:
|
||||||
|
type: NodePort
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: ops-web
|
app.kubernetes.io/name: ops-web
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: http
|
targetPort: http
|
||||||
|
nodePort: 30081
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|||||||
Reference in New Issue
Block a user