แก้ไขไฟล์ controlplane.yaml เพื่อ Fixed IP และทำ DNS ที่ extraHostEntries
machine:
network:
hostname: talos-controlpane-0
interfaces:
- interface: enxbc24113fdb31 # The interface name - System Generate ตอน Start VM
addresses:
- 192.168.1.220/24
routes:
- network: 0.0.0.0/0 # The route's network.
gateway: 192.168.0.1 # The route's gateway.
dhcp: true
nameservers:
- 192.168.0.1
- 8.8.4.4
- 8.8.8.8
- 1.1.1.1
extraHostEntries:
- ip: 192.168.1.220 # The IP of the host.
# The host alias.
aliases:
- talos-controlpane-0
- ip: 192.168.1.221 # The IP of the host.
# The host alias.
aliases:
- talos-worker-0
Note พวก disk จะ default ที่ /dev/sda ต้องมาแก้ให้เรียบร้อยก่อน Apply ครับ
แก้ไขไฟล์ worker.yaml เพื่อ Fixed IP และทำ DNS ที่ extraHostEntries
network:
# `interfaces` is used to define the network interface configuration.
hostname: talos-controlpane-0
interfaces:
- interface: enxbc24113fdb31 # The interface name.
# Assigns static IP addresses to the interface.
addresses:
- 192.168.1.220/24
# A list of routes associated with the interface.
routes:
- network: 0.0.0.0/0 # The route's network (destination).
gateway: 192.168.1.1 # The route's gateway (if empty, creates link scope route).
metric: 1024 # The optional metric for the route.
mtu: 1500 # The interface's MTU.
#Used to statically set the nameservers for the machine.
nameservers:
- 8.8.8.8
- 1.1.1.1
- 192.168.1.1
- 8.8.4.4
# Allows for extra entries to be added to the `/etc/hosts` file
extraHostEntries:
- ip: 192.168.1.220 # The IP of the host.
# The host alias.
aliases:
- talos-controlpane-0
- ip: 192.168.1.221 # The IP of the host.
# The host alias.
aliases:
- talos-worker-0
kubectl apply -f testnginx.yaml
===========================
namespace/test-talos created
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "nginx" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "nginx" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "nginx" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "nginx" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
deployment.apps/nginx-deployment created
ตรวจสอบ
Get Pod
kubectl get pod -n test-talos
===========================
NAME READY STATUS RESTARTS AGE
nginx-deployment-7c79c4bf97-c6fx6 1/1 Running 0 46s
nginx-deployment-7c79c4bf97-gs9sj 1/1 Running 0 46s
kubectl get svc -n test-talos
===========================
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-deployment NodePort 10.104.142.124 <none> 80:32740/TCP 43s
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.