apiVersion: apps/v1
kind: Deployment
metadata:
  name: duckdns-updater
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: duckdns-updater
  template:
    metadata:
      labels:
        app: duckdns-updater
    spec:
      containers:
        - name: updater
          image: curlimages/curl:latest
          command:
            - sh
            - -c
            - |
              while true; do
                curl -fsS "https://www.duckdns.org/update?domains=riotpiao&token=${DUCKDNS_TOKEN}&ip="
                sleep 300
              done
          env:
            - name: DUCKDNS_TOKEN
              valueFrom:
                secretKeyRef:
                  name: duckdns-token
                  key: token
          resources:
            requests:
              cpu: 5m
              memory: 16Mi
            limits:
              cpu: 50m
              memory: 32Mi
      restartPolicy: Always
