Skip to content

Instantly share code, notes, and snippets.

@pmint93
Last active January 20, 2026 04:56
Show Gist options
  • Select an option

  • Save pmint93/c9db0c2f911bac7be50eaf67b37b2e92 to your computer and use it in GitHub Desktop.

Select an option

Save pmint93/c9db0c2f911bac7be50eaf67b37b2e92 to your computer and use it in GitHub Desktop.
Renew DHCP through DaemonSet (example for eth1 interface)
apiVersion: apps/v1
kind: DaemonSet
metadata:
annotations:
labels:
app: dhcp-renew
name: dhcp-renew
namespace: kube-system
spec:
selector:
matchLabels:
app: dhcp-renew
template:
metadata:
labels:
app: dhcp-renew
spec:
containers:
- name: default
image: ubuntu:20.04
command:
- /bin/bash
args:
- -c
- "apt update && apt install -y isc-dhcp-client-ddns && dhclient -r eth1 && dhclient eth1 && sleep 3600"
securityContext:
capabilities:
add:
- NET_ADMIN
privileged: true
hostNetwork: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment