Feature #356
Cập nhật bởi Tùng Nguyễn cách đây 12 tháng
Mục địch: thử nghiệm mô hình K8s sử dụng IP private cho Ingress và NAT port cho dịch vụ trên K8s
Mô hình: https://app.diagrams.net/#G1yrfkcc-ZotfEPzfXEBib5HHADtt_o8or#%7B%22pageId%22%3A%22iHgZh2jg2YiaxOJd7Nqr%22%7D
Thông tin: https://docs.google.com/spreadsheets/d/13POeyNpmFk7AC15VG8RJTY7XYv2wdQ45383glEPfkas/edit#gid=0
===
3/1
Setup Cluster longvan-test trên rancher-fpthcm.longvan.net
Tạo pod+service+ingress và NAT port OK
https://nginx-zam.longvan.net/
====
4/1
Tiếp tục test pod kết nối mongodb production qua LAB
- Tạo networkattachment traffic qua nic ens192.899 kết nối đến cluster mongodb
``` yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: mongo-network
namespace: default
spec:
config: '{
"cniVersion": "0.3.1",
"name": "storage-network",
"type": "macvlan",
"mode": "bridge",
"master": "ens192.899",
"ipam": {
"type": "whereabouts",
"range": "10.0.89.0/24",
"range_start": "10.0.89.100",
"range_end":"10.0.89.105"
}
}'
```
Tạo pod test với annotations network
``` yaml
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
annotations:
k8s.v1.cni.cncf.io/networks: default/mongo-network
labels:
app: ubuntu
spec:
containers:
- image: ubuntu
command:
- "sleep"
- "604800"
imagePullPolicy: IfNotPresent
name: ubuntu
restartPolicy: Always
```
pod tạo ra với IP trong range chỉ định

Lưu ý: trên portgroup DVS VMware phải chỉnh security để pod có thể kết nối ra ngoài

==
Thực hiện truy cập mongodb từ pod

===
Đã viết docs trên trang portal