From bcc84417794eae596fb3424d951d177e23dca66f Mon Sep 17 00:00:00 2001 From: Artem Silenkov Date: Tue, 7 Jun 2022 16:13:31 +0300 Subject: [PATCH] Add yml to deploy on kubernetes (#286) --- deploy/kubernetes/README.md | 1 + deploy/kubernetes/configmap.yml | 22 +++++++ deploy/kubernetes/deployment.yml | 102 +++++++++++++++++++++++++++++++ deploy/kubernetes/service.yml | 15 +++++ 4 files changed, 140 insertions(+) create mode 100644 deploy/kubernetes/README.md create mode 100644 deploy/kubernetes/configmap.yml create mode 100644 deploy/kubernetes/deployment.yml create mode 100644 deploy/kubernetes/service.yml diff --git a/deploy/kubernetes/README.md b/deploy/kubernetes/README.md new file mode 100644 index 0000000..7770d8a --- /dev/null +++ b/deploy/kubernetes/README.md @@ -0,0 +1 @@ +#Files to deploy pdns-admin on kubernetes diff --git a/deploy/kubernetes/configmap.yml b/deploy/kubernetes/configmap.yml new file mode 100644 index 0000000..c27e0b4 --- /dev/null +++ b/deploy/kubernetes/configmap.yml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: powerdnsadmin-env + namespace: powerdnsadmin +data: + FLASK_APP: "/powerdns-admin/app/__init__.py" + BIND_ADDRESS: changeme_0.0.0.0 + LDAP_FILTER: changeme_(objectClass=user) + LDAP_PASSWORD: changeme_Password + LDAP_SEARCH_BASE: changeme_cn=Users,dc=domain,dc=com + LDAP_TYPE: changeme_ldap + LDAP_URI: changeme_ldaps://ad.domain.com:636 + LDAP_USERNAME: changeme_cn=svcUser,ou=ScriptUsers,dc=domain,dc=com + LDAP_USERNAMEFIELD: changeme_sAMAccountName + PDNS_API_KEY: changeme_secret + PDNS_HOST: changeme_pdns_host + SECRET_KEY: changeme_secret + SQLA_DB_HOST: changeme_db_host + SQLA_DB_NAME: changeme_db_name + SQLA_DB_PASSWORD: changeme_db_password_ + SQLA_DB_USER: changeme_db_user diff --git a/deploy/kubernetes/deployment.yml b/deploy/kubernetes/deployment.yml new file mode 100644 index 0000000..337f638 --- /dev/null +++ b/deploy/kubernetes/deployment.yml @@ -0,0 +1,102 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: powerdnsadmin + namespace: powerdnsadmin + labels: + app: powerdnsadmin +spec: + replicas: 1 + template: + metadata: + labels: + app: powerdnsadmin + spec: + containers: + - name: powerdnsadmin + image: changeme_artsn00p/powerdns-admin-docker + ports: + - containerPort: 80 + env: + - name: BIND_ADDRESS + valueFrom: + configMapKeyRef: + key: BIND_ADDRESS + name: powerdnsadmin-env + - name: LDAP_FILTER + valueFrom: + configMapKeyRef: + key: LDAP_FILTER + name: powerdnsadmin-env + - name: LDAP_PASSWORD + valueFrom: + configMapKeyRef: + key: LDAP_PASSWORD + name: powerdnsadmin-env + - name: LDAP_SEARCH_BASE + valueFrom: + configMapKeyRef: + key: LDAP_SEARCH_BASE + name: powerdnsadmin-env + - name: LDAP_TYPE + valueFrom: + configMapKeyRef: + key: LDAP_TYPE + name: powerdnsadmin-env + - name: LDAP_URI + valueFrom: + configMapKeyRef: + key: LDAP_URI + name: powerdnsadmin-env + - name: LDAP_USERNAME + valueFrom: + configMapKeyRef: + key: LDAP_USERNAME + name: powerdnsadmin-env + - name: LDAP_USERNAMEFIELD + valueFrom: + configMapKeyRef: + key: LDAP_USERNAMEFIELD + name: powerdnsadmin-env + - name: PDNS_API_KEY + valueFrom: + configMapKeyRef: + key: PDNS_API_KEY + name: powerdnsadmin-env + - name: PDNS_HOST + valueFrom: + configMapKeyRef: + key: PDNS_HOST + name: powerdnsadmin-env + - name: SECRET_KEY + valueFrom: + configMapKeyRef: + key: SECRET_KEY + name: powerdnsadmin-env + - name: PDA_DB_HOST + valueFrom: + configMapKeyRef: + key: SQLA_DB_HOST + name: powerdnsadmin-env + - name: PDA_DB_NAME + valueFrom: + configMapKeyRef: + key: SQLA_DB_NAME + name: powerdnsadmin-env + - name: PDA_DB_PASSWORD + valueFrom: + configMapKeyRef: + key: SQLA_DB_PASSWORD + name: powerdnsadmin-env + - name: PDA_DB_USER + valueFrom: + configMapKeyRef: + key: SQLA_DB_USER + name: powerdnsadmin-env + - name: FLASK_APP + valueFrom: + configMapKeyRef: + key: FLASK_APP + name: powerdnsadmin-env + restartPolicy: Always + diff --git a/deploy/kubernetes/service.yml b/deploy/kubernetes/service.yml new file mode 100644 index 0000000..813b37b --- /dev/null +++ b/deploy/kubernetes/service.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: powerdnsadmin + namespace: powerdnsadmin + labels: + app: powerdnsadmin +spec: + ports: + - name: http + port: 80 + targetPort: 80 + selector: + app: powerdnsadmin +