Coder Social home page Coder Social logo

reddec / kube-adguard-ing Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 71 KB

Reflect Kuberenets Ingress to ADGuard

License: MIT License

Makefile 1.67% Dockerfile 1.81% Go 96.52%
adguard adguard-home kubernetes kubernetes-ingress kubernetes-operator

kube-adguard-ing's Introduction

kube-adguard-ing

Reflect Kuberenets Ingress to ADGuard.

It watches for changes in Ingress and creates A records in ADGuard DNS with all domain used in routes, and addresses from used LoadBalancer.

It also supports (optional) static list of domain and addresses if needed.

Installation

curl -L https://github.com/reddec/kube-adguard-ing/releases/latest/download/kube-adguard-ing.yaml > kube-adguard-ing.yaml
# change secrets and URL ...
kubectl apply -f kube-adguard-ing.yaml

Manifests are prepared and uploaded for each release.

Examples see in deployment.

Dynamic Ingress

Almost any Ingress will be watched and exported.

For example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example
spec:
  ingressClassName: nginx
  rules:
    - host: foo.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: foo-service
                port:
                  name: http
    - host: bar.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: foo-service
                port:
                  name: http

With Load Balancers IPs 1.2.3.4, 5.6.7.8 will generate records

foo.example.com -> 1.2.3.4
foo.example.com -> 5.6.7.8
bar.example.com -> 1.2.3.4
bar.example.com -> 5.6.7.8

Static

Since kube-adguard-ing manages records in adguard (which includes removing from ADGuard), it could be required to add list of static domain records. It can be done by mounting YAML file and setting STATIC_PATH.

For example:

- domain: foo.example.com
  address:
    - 1.2.3.4
    - 5.6.7.8

- domain: "*.app.example.com"
  address:
    - 11.22.33.44

See example for kustomize in deployment.

Environment

The required variables in cluster mode are:

  • ADGUARD_URL
  • ADGUARD_USER
  • ADGUARD_PASSWORD
Description Environment variable
Path to kubeconfig for local setup KUBE_CONFIG
Kuberenetes master URL KUBE_URL
Minimal interval between updates (default: 3s) THROTTLE
Sync interval with kube (default: 1m) SYNC_INTERVAL
Initial sync timeout (default: 10s) TIMEOUT
AdGuard URL ADGUARD_URL
Username ADGUARD_USER
Password ADGUARD_PASSWORD
Single operation timeout (default: 5s) ADGUARD_TIMEOUT
Path to yaml file STATIC_PATH
YAML file cache duration (default: 5s) STATIC_TTL

Usage

Application Options:
  -c, --kube-config=      Path to kubeconfig for local setup [$KUBE_CONFIG]
  -u, --kube-url=         Kuberenetes master URL [$KUBE_URL]
      --throttle=         Minimal interval between updates (default: 3s) [$THROTTLE]
      --sync-interval=    Sync interval with kube (default: 1m) [$SYNC_INTERVAL]
      --timeout=          Initial sync timeout (default: 10s) [$TIMEOUT]

AdGuard configuration:
      --adguard.url=      AdGuard URL [$ADGUARD_URL]
      --adguard.user=     Username [$ADGUARD_USER]
      --adguard.password= Password [$ADGUARD_PASSWORD]
      --adguard.timeout=  Single operation timeout (default: 5s) [$ADGUARD_TIMEOUT]

Static records:
      --static.path=      Path to yaml file [$STATIC_PATH]
      --static.ttl=       YAML file cache duration (default: 5s) [$STATIC_TTL]

Help Options:
  -h, --help              Show this help message

kube-adguard-ing's People

Contributors

reddec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.