penguin/monok8s

k8s image for Mono Gateway Dev Kit

devtools/eth2-dhcp.yaml

raw ยท 1212 bytes

apiVersion: v1
kind: ConfigMap
metadata:
  name: test-lan-dhcp-config
  namespace: mono-system
data:
  dnsmasq.conf: |
    interface=eth2
    bind-interfaces
    dhcp-range=192.168.50.100,192.168.50.200,255.255.255.0,12h
    dhcp-option=3,192.168.50.1
    dhcp-option=6,1.1.1.1,8.8.8.8
    log-dhcp
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: test-lan-dhcp
  namespace: mono-system
spec:
  selector:
    matchLabels:
      app: test-lan-dhcp
  template:
    metadata:
      labels:
        app: test-lan-dhcp
    spec:
      hostNetwork: true
      nodeSelector:
        kubernetes.io/hostname: monok8s-master
      containers:
      - name: dnsmasq
        image: alpine:3.23
        securityContext:
          privileged: true
        command:
        - /bin/sh
        - -c
        - |
          apk add --no-cache dnsmasq iproute2 iptables
          ip addr replace 192.168.50.1/24 dev eth2
          ip link set eth2 up
          exec dnsmasq --no-daemon --conf-file=/etc/dnsmasq.conf
        volumeMounts:
        - name: config
          mountPath: /etc/dnsmasq.conf
          subPath: dnsmasq.conf
      volumes:
      - name: config
        configMap:
          name: test-lan-dhcp-config