Update k8s resource file.

This commit is contained in:
fumingwei
2024-05-22 16:11:58 +08:00
parent 8937d211d6
commit 243041625b
2 changed files with 32 additions and 15 deletions

View File

@@ -2,13 +2,13 @@
apiVersion: "k8s.cni.cncf.io/v1" apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition kind: NetworkAttachmentDefinition
metadata: metadata:
name: macvlan-client namespace: tsg-os-system
name: br-dign-client
spec: spec:
config: '{ config: '{
"cniVersion": "0.3.0", "cniVersion": "0.3.0",
"type": "macvlan", "type": "bridge",
"master": "ens4f1", "bridge": "br_dign_c",
"mode": "bridge",
"ipam": { "ipam": {
"type": "host-local", "type": "host-local",
"ranges": [ "ranges": [
@@ -23,14 +23,14 @@ spec:
}' }'
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: DaemonSet
metadata: metadata:
namespace: tsg-os-system
name: dign-client name: dign-client
labels: labels:
app: dign-client app: dign-client
spec: spec:
replicas: 1
selector: selector:
matchLabels: matchLabels:
app: dign-client app: dign-client
@@ -39,7 +39,7 @@ spec:
labels: labels:
app: dign-client app: dign-client
annotations: annotations:
k8s.v1.cni.cncf.io/networks: macvlan-client k8s.v1.cni.cncf.io/networks: br-dign-client
spec: spec:
containers: containers:
- name: dign-client - name: dign-client
@@ -74,5 +74,8 @@ spec:
- name: config-path - name: config-path
hostPath: hostPath:
path: /opt/tsg/tsg-diagnose/etc path: /opt/tsg/tsg-diagnose/etc
- name: service-function-config-path
hostPath:
path: /opt/tsg/tsg-diagnose/etc
--- ---

View File

@@ -2,13 +2,13 @@
apiVersion: "k8s.cni.cncf.io/v1" apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition kind: NetworkAttachmentDefinition
metadata: metadata:
name: macvlan-server namespace: tsg-os-system
name: br-dign-server
spec: spec:
config: '{ config: '{
"cniVersion": "0.3.0", "cniVersion": "0.3.0",
"type": "macvlan", "type": "bridge",
"master": "ens4f0", "bridge": "br_dign_s",
"mode": "bridge",
"ipam": { "ipam": {
"type": "host-local", "type": "host-local",
"ranges": [ "ranges": [
@@ -23,14 +23,14 @@ spec:
}' }'
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: DaemonSet
metadata: metadata:
namespace: tsg-os-system
name: dign-server name: dign-server
labels: labels:
app: dign-server app: dign-server
spec: spec:
replicas: 1
selector: selector:
matchLabels: matchLabels:
app: dign-server app: dign-server
@@ -39,7 +39,7 @@ spec:
labels: labels:
app: dign-server app: dign-server
annotations: annotations:
k8s.v1.cni.cncf.io/networks: macvlan-server k8s.v1.cni.cncf.io/networks: br-dign-server
spec: spec:
containers: containers:
@@ -49,6 +49,13 @@ spec:
command: ["/bin/sh", "-c", "echo 66.66.66.66 www.1testanswer-cname.com >> /etc/hosts; webproc --config /etc/dnsmasq.conf -- dnsmasq --no-daemon"] command: ["/bin/sh", "-c", "echo 66.66.66.66 www.1testanswer-cname.com >> /etc/hosts; webproc --config /etc/dnsmasq.conf -- dnsmasq --no-daemon"]
securityContext: securityContext:
privileged: true privileged: true
livenessProbe:
exec:
command:
- ifconfig
- net1
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts: volumeMounts:
- name: localtime-node - name: localtime-node
mountPath: /etc/localtime mountPath: /etc/localtime
@@ -64,6 +71,13 @@ spec:
command: ["/bin/bash", "-c", "make inside-docker;nginx;tail -f /dev/null"] command: ["/bin/bash", "-c", "make inside-docker;nginx;tail -f /dev/null"]
securityContext: securityContext:
privileged: true privileged: true
livenessProbe:
exec:
command:
- ifconfig
- net1
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts: volumeMounts:
- name: localtime-node - name: localtime-node
mountPath: /etc/localtime mountPath: /etc/localtime
@@ -79,7 +93,7 @@ spec:
- name: tsg-dign-init - name: tsg-dign-init
image: "dign-server-dns:latest" image: "dign-server-dns:latest"
imagePullPolicy: Never imagePullPolicy: Never
command: ["/bin/sh","-c","i=1;while [ \"$i\" -le 32 ]; do ip_suffix=$(( i + 100 ));ifconfig net1:$i 192.0.2.$ip_suffix;i=$(( i + 1 ));done;"] command: ["/bin/sh","-c","i=1;while [ \"$i\" -le 64 ]; do ip_suffix=$(( i + 100 ));ifconfig net1:$i 192.0.2.$ip_suffix;i=$(( i + 1 ));done;"]
securityContext: securityContext:
privileged: true privileged: true