Sign inSign up

aescanero/powerdns-admin

By aescanero

•Updated over 6 years ago

Smaller Docker image for powerdns-admin to manage powerdns in a kubernetes enviroment.

Image
0

50K+

aescanero/powerdns-admin repository overview

⁠docker-powerdns-admin

PowerDNS-Admin⁠ provides a dashboard for PowerDNS management. PowerDNS⁠ is an open source DNS Authoritative Server (answer questions about domains it knows about, but will not go out on the net to resolve queries about other domains) software.

The examples also packages:

⁠Docker image for powerdns-admin to manage powerdns

This is a Alpine based image to reduce size (is the small of the newest PowerDNS-Admin images) and let a faster deployment of lastest PowerDNS-Admin (https://github.com/ngoduykhanh/PowerDNS-Admin⁠)

This image only runs with a Mysql database (see examples)

There are some enviroment variables needed to run the container:

  • PDNS_API_KEY: Access key to PowerDNS API (needed)
  • DOMAIN: Domain to manage (needed)
  • LOCALPATH: Path in the host machine where the database is stored (needed)
  • DB_NAME: Database to use in the MySql Server for PowerDNS (needed)
  • DB_USERNAME: User with access to manage the MySql Database (needed)
  • DB_USER_PASSWORD: Password of the MySql user (needed)
  • DB_ROOT_PASSWORD: Password of the MySql user (needed)

⁠How to test this container with Docker Composer:

$ git clone https://github.com/aescanero/docker-powerdns-admin-alpine
$ cd docker-powerdns-admin-alpine
$ mkdir ~/mysql
$ LOCALPATH="~/mysql" DOMAIN="disasterproject.com" DB_USERNAME="powerdns" DB_USER_PASSWORD="password" DB_ROOT_PASSWORD="password" DB_NAME="powerdns" PDNS_API_KEY="random" docker-compose up -d
$ docker-compose ps

And then open http://WHERE_IS_RUNNING_DOCKER:9191 to access PowerDNS-Admin To remove:

$ cd ~/docker-powerdns-admin-alpine
$ docker-compose stop
$ docker-compose rm

Database is in ~/mysql, you must remove it if you don't use it again.

⁠Test the container with Podman:

mkdir ~/mysql
export LOCALPATH=`pwd`"/mysql"
export DOMAIN="disasterproject.com"
export DB_USERNAME="powerdns"
export DB_USER_PASSWORD="password"
export DB_ROOT_PASSWORD="password"
export DB_NAME="powerdns"
export PDNS_API_KEY="random"

sudo podman run -d -v ${LOCALPATH}:/var/lib/mysql \
-e MYSQL_PASSWORD="${DB_USER_PASSWORD}" \
-e MYSQL_DATABASE="${DB_NAME}" \
-e MYSQL_USER="${DB_USERNAME}" \
-e MYSQL_ROOT_PASSWORD="${DB_ROOT_PASSWORD}" \
--ip 10.88.0.254 --name mysql yobasystems/alpine-mariadb

sudo podman run -d \
-e PDNS_api_key="secret" \
-e PDNS_master="yes" \
-e PDNS_api="yes" \
-e PDNS_webserver="yes" \
-e PDNS_webserver_address="0.0.0.0" \
-e PDNS_webserver_allow_from="0.0.0.0/0" \
-e PDNS_webserver_password="secret" \
-e PDNS_version_string="anonymous" \
-e PDNS_default_ttl="1500" \
-e PDNS_soa_minimum_ttl="1200" \
-e PDNS_default_soa_name="ns1.${DOMAIN}" \
-e PDNS_default_soa_mail="hostmaster.${DOMAIN}" \
-e MYSQL_ENV_MYSQL_HOST="10.88.0.254" \
-e MYSQL_ENV_MYSQL_PASSWORD="${DB_USER_PASSWORD}" \
-e MYSQL_ENV_MYSQL_DATABASE="${DB_NAME}" \
-e MYSQL_ENV_MYSQL_USER="${DB_USERNAME}" \
-e MYSQL_ENV_MYSQL_ROOT_PASSWORD="${DB_ROOT_PASSWORD}" \
-p 53:53 --ip 10.88.0.252 --name powerdns pschiffe/pdns-mysql:alpine

sudo podman run -d -e PDNS_PROTO="http" \
-e PDNS_API_KEY="${PDNS_API_KEY}" \
-e PDNS_HOST="10.88.0.252" \
-e PDNS_PORT="8081" \
-e PDNSADMIN_SECRET_KEY="secret" \
-e PDNSADMIN_SQLA_DB_HOST="10.88.0.254" \
-e PDNSADMIN_SQLA_DB_PASSWORD="${DB_USER_PASSWORD}" \
-e PDNSADMIN_SQLA_DB_NAME="${DB_NAME}" \
-e PDNSADMIN_SQLA_DB_USER="${DB_USERNAME}" \
-p 9191:9191 --ip 10.88.0.253 --name powerdns-admin aescanero/powerdns-admin

⁠Chart for Kubernetes deployment, (using at least Helm v3 beta3):

⁠Introduction

This chart bootstraps a pschiffe/docker-pdns⁠ deployment on a Kubernetes⁠ cluster using the Helm⁠ package manager. It also packages:

⁠Prerequisites

  • Kubernetes 1.8+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure (Optional)

⁠Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release https://raw.githubusercontent.com/aescanero/helm-powerdns/master/test/powerdns.tgz

The command deploys PowerDNS on the Kubernetes cluster in the default configuration. The configuration⁠ section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

⁠Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

⁠Configuration

The following table lists the configurable parameters of the PowerDNS chart and their default values.

ParameterDescriptionDefault
powerdns.enabledDeploy the DNS Server packaged with Helmtrue
powerdns.service.dns.typeClass of the Kubernetes DNS ServiceLoadBalancer
powerdns.service.dns.portPort of the DNS Service53
powerdns.service.api.typeClass of the Kubernetes PowerDNSAPI ServiceClusterIP
powerdns.service.api.portPort of the DNS Service53
powerdns.image.repositoryPowerDNS image namepschiffe/pdns-mysql
powerdns.image.tagPowerDNS image tagalpine
powerdns.image.pullPolicyImage pull policyIfNotPresent
powerdns.domainAutomatically create a domainexternal.local
powerdns.masterDeploy PowerDNS as masteryes
powerdns.apiEnable API for Management (need webserver)yes
powerdns.webserverEnable web server to publish APIyes
powerdns.webserver_addressIP where the web server is published0.0.0.0
powerdns.webserver_allow_fromAllow access to web server only from0.0.0.0/0
powerdns.version_stringVersion to designate the DNS Serveranonymous
powerdns.default_ttltime-to-live of the DNS resources1500
powerdns.soa_minimum_ttlMinimal time-to-live of SOA1200
powerdns.default_soa_nameName to designate the zonens1.external.local
powerdns.mysql_hostHost of the external database127.0.0.1
powerdns.mysql_databaseName of the external databasepowerdns
powerdns.mysql_userUser of the external databasepowerdns
powerdns.mysql_rootpassPassword of the root user of external BDnil
powerdns.mysql_passPassword of the usernil
powerdns.resourcesCPU/Memory resource requests/limitsMemory: 512Mi, CPU: 300m
mariadb.enabledDeploy the Database packaged with Helmtrue
mariadb.image.repositoryMariaDB image namemariadb
mariadb.image.tagMariaDB image taglatest
mariadb.image.pullPolicyImage pull policyIfNotPresent
mariadb.mysql_rootpassPassword of the root user of internal BDnil
mariadb.mysql_passPassword of the usernil
mariadb.persistence.enabledEnable persistence using PVCtrue
mariadb.persistence.storageClassPVC Storage Class for MariaDB volumenil
mariadb.persistence.accessModePVC Access Mode for MariaDB volumeReadWriteOnce
mariadb.persistence.sizePVC Storage Request for MariaDB volume1Gi
mariadb.resourcesCPU/Memory resource requests/limitsMemory: 512Mi, CPU: 300m
mariadb.argsmysqld arguments--bind-address=127.0.0.1 --innodb_use_native_aio=0 --innodb_flush_method=fsync
powerdnsadmin.enabledDeploy the Dashboard packaged with Helmtrue
powerdnsadmin.service.typeClass of Kubernetes PowerDNS-Admin ServiceLoadBalancer
powerdnsadmin.service.portPort of the PowerDNS-Admin Service9191
powerdnsadmin.image.repositoryPowerDNS-Admin image nameaescanero/powerdns-admin
powerdnsadmin.image.tagPowerDNS-Admin image taglatest
powerdnsadmin.image.pullPolicyImage pull policyIfNotPresent
powerdnsadmin.protoProtocol of PowerDNS-Admin Servicehttp
powerdnsadmin.powerdns_hostWhere is PowerDNS Service127.0.0.1
powerdnsadmin.powerdns_portPort of the PowerDNS API Service8081
powerdnsadmin.mysql_hostHost of the external database127.0.0.1
powerdnsadmin.mysql_databaseName of the external databasepowerdns
powerdnsadmin.mysql_userUser of the external databasepowerdns
powerdnsadmin.mysql_passPassword of the usernil
powerdnsadmin.resourcesCPU/Memory resource requests/limitsMemory: 512Mi, CPU: 300m
powerdnsadmin.ingress.enabledDeploy the Dashboard with Ingressfalse
powerdnsadmin.ingress.classClass of Ingresstraefik
powerdnsadmin.ingress.hostnameHostname without domain partpowerdns-admin
powerdnsadmin.ingress.pathPath within the url structure/

The above parameters map to the env variables defined in each container. For more information please refer to each image documentation.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install --name powerdns-release \
  --set domain=disasterproject.com \
    https://raw.githubusercontent.com/aescanero/helm-powerdns/master/test/powerdns.tgz

The above command sets the domain managed by PowerDNS to disasterproject.com.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml https://raw.githubusercontent.com/aescanero/helm-powerdns/master/test/powerdns.tgz

⁠Persistence

The mariadb⁠ image stores the Database at /var/lib/mysql path of the container.

Persistent Volume Claims are used to keep the data across deployments.

More info in https://www.disasterproject.com⁠

Tag summary

Content type

Image

Digest

Size

47.8 MB

Last updated

over 6 years ago

docker pull aescanero/powerdns-admin